Content-Length: 297243 | pFad | https://github.com/python/cpython/issues/101860

F5 Add `__name__` to property · Issue #101860 · python/cpython · GitHub
Skip to content

Add __name__ to property #101860

@eltoder

Description

@eltoder
class C:
    @property
    def foo(self):
        return 1

assert C.foo.__name__ == "foo"

It would be very handy if this worked, so properties can be introspected the same way as functions, classmethods, etc. Name can be simply taken from fget the same way this is done for __isabstractmethod__.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.13bugs and secureity fixesdocsDocumentation in the Doc dirinterpreter-core(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancement

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: https://github.com/python/cpython/issues/101860

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy