[Python-Dev] slots, properties, descriptors, and pydoc (original) (raw)
Fred L. Drake, Jr. fdrake at acm.org
Mon Apr 19 00:29:57 EDT 2004
- Previous message: [Python-Dev] slots, properties, descriptors, and pydoc
- Next message: [Python-Dev] slots, properties, descriptors, and pydoc
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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. PythonLabs at Zope Corporation
- Previous message: [Python-Dev] slots, properties, descriptors, and pydoc
- Next message: [Python-Dev] slots, properties, descriptors, and pydoc
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]