Fred L. Drake, Jr. wrote: > How about: > > class Foo(object): > docslots(slot1='description', > slot2=("Some really long\n" > "multi-line description."), > ...) My intention was to make something that can completely replace the current __slots__ pattern. Your proposal doesn't support slots that don't have a docstring very naturally (you'd use slot=''). Attached is another strategy that uses optional tuples. Combined with my pydoc patch, class Foo(object): slots( ('slot1', 'description'), ('slot2', """description ...continued"""), 'slot3', ('_slot4', 'hidden'), ) yields this help: class Foo(__builtin__.object) | Data descriptors defined here: | | slot1 | description | slot2 | description | ...continued | slot3 -John -- http:// if ile.org/ -------------- next part -------------- A non-text attachment was scrubbed... Name: slots.py Type: text/x-python Size: 2050 bytes Desc: not available Url : http://mail.python.org/pipermail/python-dev/attachments/20040418/d4400ae9/slots.py
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4