Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #20523

Re: list of properties

Path csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.012
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'attribute': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'def': 0.13; 'attributes.': 0.16; 'received:173.11': 0.16; '(i.e.': 0.17; 'instance': 0.18; 'subject:list': 0.21; 'header:In-Reply-To:1': 0.22; 'defined': 0.24; 'import': 0.27; 'class': 0.29; 'print': 0.29; 'list': 0.32; 'there': 0.33; 'header:User-Agent:1': 0.33; 'header:X-Complaints-To:1': 0.34; 'to:addr:python-list': 0.35; 'received:org': 0.36; 'hello,': 0.37; 'skip:_ 10': 0.38; 'returned': 0.39; 'to:addr:python.org': 0.40; '9:19': 0.84; 'emmanuel': 0.84; 'subject:properties': 0.84
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Emile van Sebille <emile@fenx.com>
Subject Re: list of properties
Date Thu, 16 Feb 2012 10:02:38 -0800
References <CACB6ZmB4RDCFKU_jxZXU=jThHa=8Q6r=P-X4fgqvdrW7NE2WLg@mail.gmail.com>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host 173-11-108-137-sfba.hfc.comcastbusiness.net
User-Agent Mozilla/5.0 (Windows NT 5.1; rv:9.0) Gecko/20111222 Thunderbird/9.0.1
In-Reply-To <CACB6ZmB4RDCFKU_jxZXU=jThHa=8Q6r=P-X4fgqvdrW7NE2WLg@mail.gmail.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.5895.1329415247.27778.python-list@python.org> (permalink)
Lines 43
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1329415247 news.xs4all.nl 6847 [2001:888:2000:d::a6]:45801
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:20523

Show key headers only | View raw


On 2/16/2012 9:19 AM Emmanuel Mayssat said...
> Hello,
>
> Is there a way to list 'properties' ?

dir(thingy)

>
>
> from PyQt4.QtCore import *
>
> class LObject(QObject):
>      def __init__(self, parent=None):
>          super(LObject, self).__init__(parent)
>          self.arg1 = 'toto'
>
>      def getArg2(self):
>          return self.arg1 + " <--"
>      arg2 = property(getArg2)
>
> l = LObject()
> print l.__dict__
>
> returns only arg1

arg2 is defined at the class level and not the instance level. 
l.__dict__ returned the instance attributes. Look in LObject.__dict__ 
for arg2.

Emile


>
>
> How can I find that arg2 is a 'virtual' attribute (i.e. property)?
>
> Regards,
> --
> E
>
>

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: list of properties Emile van Sebille <emile@fenx.com> - 2012-02-16 10:02 -0800

csiph-web