This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: property missing doc'd __name__ attr
Type: Stage:
Components: Documentation Versions: Python 2.2
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: nnorwitz Nosy List: mcfletch, nnorwitz
Priority: normal Keywords:

Created on 2002-09-22 21:55 by mcfletch, last changed 2022-04-10 16:05 by admin. This issue is now closed.

Messages (2)
msg12454 - (view) Author: Mike C. Fletcher (mcfletch) Date: 2002-09-22 21:55
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
msg12455 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2002-12-17 00:53
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.
History
Date User Action Args
2022-04-10 16:05:41adminsetgithub: 37203
2002-09-22 21:55:41mcfletchcreate