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.

Author pitrou
Recipients eric.araujo, ncoghlan, pitrou, python-dev, sbt, vstinner
Date 2011-11-26.00:31:01
SpamBayes Score 2.8161756e-07
Marked as misclassified No
Message-id <1322267163.3272.45.camel@localhost.localdomain>
In-reply-to <1322265131.5.0.631848129099.issue13448@psf.upfronthosting.co.za>
Content
> There are some callables which are missing __qualname__:
> 
>   method_descriptor
>   wrapper_descriptor
>   builtin_function_or_method
> 
> For the descriptors, at least, obj.__qualname__ should be equivalent to
> 
>   obj.__objclass__.__qualname__ + '.' + obj.__name__
> 
> Were these overlooked?

Indeed, they were overlooked. Due to the way they are instantiated,
though, it would be quite a bit harder to devise a __qualname__ for
them.

> Also I notice that bound methods have a misleading __qualname__:
> 
>   >>> class A:
>   ...   def f(self): pass
>   ...
>   [66348 refs]
>   >>> A().f.__qualname__
>   'A.f'
> 
> Maybe this should be 'A().f' instead.

I am a bit surprised that this works at all. Apparently attribute
lookups are redirected to the underlying function.
History
Date User Action Args
2011-11-26 00:31:02pitrousetrecipients: + pitrou, ncoghlan, vstinner, eric.araujo, python-dev, sbt
2011-11-26 00:31:01pitroulinkissue13448 messages
2011-11-26 00:31:01pitroucreate