[issue25590] tab-completition on instances repeatedly accesses attribute/descriptors values

2015-11-13 Thread Ezio Melotti
Ezio Melotti added the comment: Thanks for taking care of this! -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscrib

[issue25590] tab-completition on instances repeatedly accesses attribute/descriptors values

2015-11-13 Thread Martin Panter
Martin Panter added the comment: I also ported the getattr patch to the 2.7 branch. -- resolution: -> fixed stage: commit review -> resolved status: open -> closed versions: +Python 2.7 ___ Python tracker

[issue25590] tab-completition on instances repeatedly accesses attribute/descriptors values

2015-11-13 Thread Roundup Robot
Roundup Robot added the comment: New changeset 16d83e11675f by Martin Panter in branch '2.7': Issue #25590: Make rlcompleter only call getattr() once per attribute https://hg.python.org/cpython/rev/16d83e11675f -- ___ Python tracker

[issue25590] tab-completition on instances repeatedly accesses attribute/descriptors values

2015-11-13 Thread Roundup Robot
Roundup Robot added the comment: New changeset 92f989bfeca2 by Martin Panter in branch '3.4': Issue #25590: Make rlcompleter only call getattr() once per attribute https://hg.python.org/cpython/rev/92f989bfeca2 New changeset 808279e14700 by Martin Panter in branch '3.5': Issue #25590: Merge rlco

[issue25590] tab-completition on instances repeatedly accesses attribute/descriptors values

2015-11-12 Thread Martin Panter
Martin Panter added the comment: Yeah I plan to merge the first patch (fixing conflicts) into 3.6 without any of the uncreated-property additions, and then apply that extra stuff in a separate commit. Using __slots__ would be simpler; I’ll switch it over. -- _

[issue25590] tab-completition on instances repeatedly accesses attribute/descriptors values

2015-11-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Both patches LGTM. Thank you Martin. > Would we consider this a new feature for 3.6? We can consider this a fix of the regression in issue449227. But this behavior here is so long. I agree with applying it to 3.6 only. For nicer Mercurial history, it would

[issue25590] tab-completition on instances repeatedly accesses attribute/descriptors values

2015-11-10 Thread Martin Panter
Martin Panter added the comment: uncreated-attr.patch is against the 3.6 branch, and includes the excessive getattr() test, and new code to include uncreated attribute names. I added a paragraph to What’s New describing the new completion behaviour. -- Added file: http://bugs.python.or

[issue25590] tab-completition on instances repeatedly accesses attribute/descriptors values

2015-11-10 Thread Martin Panter
Martin Panter added the comment: getattr-once.patch handles my first two points. It backports the set() change, and avoids the hasattr() check. I guess we apply this to 3.4+; expect merge conflicts with 3.6. As for the last point, I will make another patch to include special attributes that d

[issue25590] tab-completition on instances repeatedly accesses attribute/descriptors values

2015-11-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Agreed with all your suggestions Martin. Do you want to write a patch? -- stage: test needed -> needs patch ___ Python tracker ___ ___

[issue25590] tab-completition on instances repeatedly accesses attribute/descriptors values

2015-11-09 Thread Martin Panter
Martin Panter added the comment: Illustration of why I think removing the attribute on errors is bad: >>> class Foo: ... @property ... def bar(self): return self._bar ... @bar.setter ... def bar(self, value): self._bar = value ... >>> f = Foo() >>> f.bar = ... # Tab completion fails in

[issue25590] tab-completition on instances repeatedly accesses attribute/descriptors values

2015-11-09 Thread Martin Panter
Martin Panter added the comment: Long story short: it is accessed due to the callable suffix check (Issue 449227), and this check is less than optimal, meaning the attribute gets accessed up to four times per Tab press. In 3.6, there are only two calls, one for the hasattr() call, and one for

[issue25590] tab-completition on instances repeatedly accesses attribute/descriptors values

2015-11-09 Thread Ezio Melotti
New submission from Ezio Melotti: Pressing to invoke autocompletition on instances repeatedly accesses attributes/descriptors values: >>> # is used to indicate when/where I press >>> class Foo: ... @property ... def bar(self): print('Foo.bar called') ... >>> f = Foo() >>> f.Foo.bar call