How do I access the property info in this example ?

Discussion in 'Python' started by David Poundall, Oct 26, 2005.

  1. How do I access the property information in this example ?

    class C(object):
    def getx(self): return self.__x
    def setx(self, value): self.__x = value
    def delx(self): del self.__x
    x = property(getx, setx, delx, "I'm the 'x' property.")

    I would like to get at ...

    "I'm the 'x' property."

    .... if at all possible.

    TIA
     
    David Poundall, Oct 26, 2005
    #1
    1. Advertising

  2. David Poundall enlightened us with:
    > class C(object):
    > def getx(self): return self.__x
    > def setx(self, value): self.__x = value
    > def delx(self): del self.__x
    > x = property(getx, setx, delx, "I'm the 'x' property.")
    >
    > I would like to get at ...
    >
    > "I'm the 'x' property."


    As usual: C.x.__doc__

    Sybren
    --
    The problem with the world is stupidity. Not saying there should be a
    capital punishment for stupidity, but why don't we just take the
    safety labels off of everything and let the problem solve itself?
    Frank Zappa
     
    Sybren Stuvel, Oct 26, 2005
    #2
    1. Advertising

  3. Thanks - I was trying to do ....

    c = C()
    print c.x.__doc__

    my mistake.
     
    David Poundall, Oct 26, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Vasanth
    Replies:
    0
    Views:
    599
    Vasanth
    Jun 28, 2004
  2. Andrea Williams

    Clear the Render info & change to different info

    Andrea Williams, Oct 27, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    1,456
    Ken Dopierala Jr.
    Oct 27, 2004
  3. Kiran
    Replies:
    0
    Views:
    1,255
    Kiran
    Feb 6, 2005
  4. ilya

    get CPU info, RAM info

    ilya, Apr 8, 2010, in forum: Java
    Replies:
    43
    Views:
    6,253
    Mike Schilling
    Apr 19, 2010
  5. Kenshin
    Replies:
    1
    Views:
    243
    Jeff Cochran
    Jun 25, 2004
Loading...

Share This Page