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

noreply@sourceforge.net noreply@sourceforge.net
Mon, 16 Dec 2002 16:53:27 -0800


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: Documentation
Group: Python 2.2
>Status: Closed
>Resolution: Invalid
Priority: 5
Submitted By: Mike C. Fletcher (mcfletch)
>Assigned to: Neal Norwitz (nnorwitz)
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

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

>Comment By: Neal Norwitz (nnorwitz)
Date: 2002-12-16 19:53

Message:
Logged In: YES 
user_id=33168

Properties are described in section 2.4.  You are correct
that properties do not have __name__ attributes.  

The section which references __name__ is 2.2.  This section
is describing descriptors like classmethod and static method
which do have __name__.  Therefore, I'm closing this bug.

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

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