source for the property function

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rowland Smith

    source for the property function

    Anyone know where the source code for the built-in property function
    is located in a python distribution?

    I would like to see how it works - mainly, how does it know which
    class it is being called from?

    Thanks,
    Rowland

  • Diez B. Roggisch

    #2
    Re: source for the property function

    Rowland Smith schrieb:
    Anyone know where the source code for the built-in property function is
    located in a python distribution?
    >
    I would like to see how it works - mainly, how does it know which class
    it is being called from?

    Google the "descriptor protocol" for new-style classes. That explains it.

    Diez

    Comment

    Working...