[Python-Dev] Writable doc (original) (raw)
Ethan Furman ethan at stoneleaf.us
Thu Jan 19 01:01:23 CET 2012
- Previous message: [Python-Dev] Daily reference leaks (12de1ad1cee8): sum=6024
- Next message: [Python-Dev] Writable __doc__
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Is there a reason why normal classes can't have their doc strings rewritten? Creating a do-nothing metaclass seems like overkill for such a simple operation.
Python 3.2 ... on win32 --> class Test(): ... doc = 'am I permanent?' ... --> Test.doc 'am I permanent?' --> Test.doc = 'yes' Traceback (most recent call last): File "", line 1, in AttributeError: attribute 'doc' of 'type' objects is not writable --> type(Test) <class 'type'>
--> class Meta(type): ... "only for exists to allow writable doc" ... --> class Test(metaclass=Meta): ... doc = 'am I permanent?' ... --> Test.doc 'am I permanent?' --> Test.doc = 'No!' --> Test.doc 'No!' --> type(Test) <class '__main__.Meta'>
Should I create a bug report?
Ethan
- Previous message: [Python-Dev] Daily reference leaks (12de1ad1cee8): sum=6024
- Next message: [Python-Dev] Writable __doc__
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]