[Python-bugs-list] [ python-Bugs-612969 ] property missing doc'd __name__ attr

noreply@sourceforge.net noreply@sourceforge.net
Sun, 22 Sep 2002 14:55:41 -0700


Bugs item #612969, was opened at 2002-09-22 17:55
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=612969&group_id=5470

Category: Type/class unification
Group: Python 2.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Mike C. Fletcher (mcfletch)
Assigned to: Nobody/Anonymous (nobody)
Summary: property missing doc'd __name__ attr

Initial Comment:
The whatsnew document states that descriptors have an
attribute __name__:

"""
Attribute descriptors are objects that live inside
class objects, and have a few attributes of their own:

* __name__ is the attribute's name.
"""
http://www.python.org/doc/2.2.1/whatsnew/sect-rellinks.html#SECTION000320000000000000000

But in real-world tests with Python 2.2.1 on Win32:
>>> class a( object ):
...     b = property(  )
...
>>> a.b.__name__
Traceback (most recent call last):
  File "<interactive input>", line 1, in ?
AttributeError: 'property' object has no attribute
'__name__'
>>>

Now, of course, the __name__ attribute wouldn't be that
useful, given that the descriptor could be
multiply-referenced under different names, but I'd
guess either the value should be present, or it should
not be in the whatsnew documentation.  Would likely
need to be handled via a mechanism similar to
bound-and-unbound methods to make the __name__
attribute useful.

Enjoy,
Mike

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=612969&group_id=5470