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 ezio.melotti
Recipients ezio.melotti
Date 2015-11-09.22:15:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1447107343.63.0.0427300203207.issue25590@psf.upfronthosting.co.za>
In-reply-to
Content
Pressing <tab> to invoke autocompletition on instances repeatedly accesses attributes/descriptors values:

>>> # <tab> is used to indicate when/where I press <tab>
>>> class Foo:
...   @property
...   def bar(self): print('Foo.bar called')
... 
>>> f = Foo()
>>> f.<tab>Foo.bar called 
Foo.bar called
Foo.bar called
Foo.bar called
<tab>Foo.bar called
Foo.bar called
Foo.bar called
Foo.bar called
<tab>
f.__class__(         f.__doc__            f.__getattribute__(  f.__le__(            f.__new__(           f.__setattr__(       f.__weakref__
f.__delattr__(       f.__eq__(            f.__gt__(            f.__lt__(            f.__reduce__(        f.__sizeof__(        f.bar
f.__dict__           f.__format__(        f.__hash__(          f.__module__         f.__reduce_ex__(     f.__str__(           
f.__dir__(           f.__ge__(            f.__init__(          f.__ne__(            f.__repr__(          f.__subclasshook__(  
>>> f.b<tab>Foo.bar called
Foo.bar called
Foo.bar called
Foo.bar called
ar<enter>
Foo.bar called

Each time I press <tab>, the property is called 4 times.  I'm not sure why the value is accessed at all, but even if there was a valid reason to do so, doing it once should be enough.
History
Date User Action Args
2015-11-09 22:15:43ezio.melottisetrecipients: + ezio.melotti
2015-11-09 22:15:43ezio.melottisetmessageid: <1447107343.63.0.0427300203207.issue25590@psf.upfronthosting.co.za>
2015-11-09 22:15:43ezio.melottilinkissue25590 messages
2015-11-09 22:15:42ezio.melotticreate