On Sunday 18 April 2004 11:16 pm, John Belmonte wrote: > 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=''). Please don't misunderstand; I wasn't making a proposal, but was just responding to your question about what can be done. I've no doubt something better can be done, and if anything is done as part of stock Python, it would need to be. That said, docless slots would not be handled any differently with my sample code than they are now; just name them in __slots__. My docslots() function was very careful not to blindly overwrite an existing __slots__. So this: class Sample(object): __slots__ = "slot1", docslots(slot2="description") would work just fine. -Fred -- Fred L. Drake, Jr. <fdrake at acm.org> PythonLabs at Zope Corporation
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