[issue5890] Subclassing property doesn't preserve the auto __doc__ behavior

2009-11-18 Thread Moriyoshi Koizumi
Moriyoshi Koizumi added the comment: @r.david.murray > If MyProp is such a subclass, would > print Fro.baz.__doc__ print "Get a baz" in 2.6.2 but raise an error in > 2.6.3/4, or would it print None? Just let it return None as they were for now. I completely agree there's a better fix like del

[issue5890] Subclassing property doesn't preserve the auto __doc__ behavior

2009-11-16 Thread R. David Murray
R. David Murray added the comment: Well, I haven't worked with boost or any other extension class that defines a subclass of property. If MyProp is such a subclass, would print Fro.baz.__doc__ print "Get a baz" in 2.6.2 but raise an error in 2.6.3/4, or would it print None? Regardless of which

[issue5890] Subclassing property doesn't preserve the auto __doc__ behavior

2009-11-16 Thread Moriyoshi Koizumi
Moriyoshi Koizumi added the comment: Sorry, I don't quite have an idea on the part "these patches reenable the bug". The script of the first message yields exactly the same result both with the original 2.6.4 and the patched. Assuming the weirdness you referred to is different from 5890, I'd sa

[issue5890] Subclassing property doesn't preserve the auto __doc__ behavior

2009-11-15 Thread R. David Murray
R. David Murray added the comment: It seems to me that all that patch does is re-enable the bug (in the extension class context) that the patch for this issue was a workaround for. I think perhaps the correct fix is to look at how the __doc__ attribute is found in the general case and see if it

[issue5890] Subclassing property doesn't preserve the auto __doc__ behavior

2009-11-11 Thread Moriyoshi Koizumi
Moriyoshi Koizumi added the comment: and the other one -- Added file: http://bugs.python.org/file15312/issue5890-refix-trunk.patch ___ Python tracker ___

[issue5890] Subclassing property doesn't preserve the auto __doc__ behavior

2009-11-11 Thread Moriyoshi Koizumi
Moriyoshi Koizumi added the comment: I created a patch against trunk and 2.6-maint that lets it simply ignore the error that might happen during PyObject_SetAttrString(); -- Added file: http://bugs.python.org/file15311/issue5890-refix-py2.6.patch ___

[issue5890] Subclassing property doesn't preserve the auto __doc__ behavior

2009-11-11 Thread Moriyoshi Koizumi
Moriyoshi Koizumi added the comment: A subclass of property doesn't always have writable __doc__, especially what is implemented in C. This actually causes a problem with Boost.Python's StaticProperty. References: - http://mail.python.org/pipermail/cplusplus-sig/2009-August/014747.html - htt

[issue5890] Subclassing property doesn't preserve the auto __doc__ behavior

2009-05-04 Thread R. David Murray
R. David Murray added the comment: Reviewed by Georg and approved on #python-dev. Committed in r72299, r72301, r72302, and r72304. -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker

[issue5890] Subclassing property doesn't preserve the auto __doc__ behavior

2009-05-04 Thread R. David Murray
Changes by R. David Murray : Removed file: http://bugs.python.org/file13876/issue5890.patch ___ Python tracker ___ ___ Python-bugs-list mailing

[issue5890] Subclassing property doesn't preserve the auto __doc__ behavior

2009-05-04 Thread R. David Murray
Changes by R. David Murray : Removed file: http://bugs.python.org/file13832/issue5890.patch ___ Python tracker ___ ___ Python-bugs-list mailing

[issue5890] Subclassing property doesn't preserve the auto __doc__ behavior

2009-05-04 Thread R. David Murray
R. David Murray added the comment: Updated patch with refleak fixed. Thanks Georg. -- Added file: http://bugs.python.org/file13878/issue5890.patch ___ Python tracker ___ ___

[issue5890] Subclassing property doesn't preserve the auto __doc__ behavior

2009-05-04 Thread R. David Murray
R. David Murray added the comment: Updated patch that updates property_copy so that the __doc__ string is also copied appropriately when getter, setter, or deller are used. A bunch more tests, as well. I refactored property_copy to make it reuse the logic in property_init directly. Unfortunate

[issue5890] Subclassing property doesn't preserve the auto __doc__ behavior

2009-05-01 Thread R. David Murray
R. David Murray added the comment: Fixes from review on #python-dev by Benjamin. It looks like I also need to look at property_copy. -- Added file: http://bugs.python.org/file13832/issue5890.patch ___ Python tracker

[issue5890] Subclassing property doesn't preserve the auto __doc__ behavior

2009-05-01 Thread R. David Murray
Changes by R. David Murray : Removed file: http://bugs.python.org/file13831/issue5890.patch ___ Python tracker ___ ___ Python-bugs-list mailing

[issue5890] Subclassing property doesn't preserve the auto __doc__ behavior

2009-05-01 Thread R. David Murray
R. David Murray added the comment: What is happening here is that when __doc__ is looked up, it is found first among the attributes of the class type. __doc__ is special, and types define it to be None if it not set to anything specific. So the docstring for an instance of a subclass of proper

[issue5890] Subclassing property doesn't preserve the auto __doc__ behavior

2009-04-30 Thread George Sakkis
New submission from George Sakkis : Is the following behavior expected ? class MyProp(property): pass class Foo(object): @property def bar(self): '''Get a bar.''' @MyProp def baz(self): '''Get a baz.''' >>> print Foo.bar.__doc__ Get a bar. >>> print F