[issue30495] IDLE: modernize textview module

Terry J. Reedy report at bugs.python.org
Wed May 31 02:05:25 EDT 2017


Terry J. Reedy added the comment:

1. I prefer to not deal with ttk styles yet, unless forced, and we don't seem to be here.
2. Yes, I wanted to get rid of that useless frame as part of refactoring.
3. 'self.x = x = expr' is a semi-common idiom.  A local name is nice when there are multiple local references to the object.  Dereferencing a local name is faster than an attribute, though it may not be enough to worry about unless there is a loop.  No having so many 'self.' prefixes makes the code less cluttered and probably easier to read. The attribute is obviously needed to (directly) refer to the widget outside the method, whether in other methods of the class or outside functions such as in tests. You have probably noticed expression statements, like "Widget(parent, opt=val).grid(...), where no Python binding is kept.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30495>
_______________________________________


More information about the Python-bugs-list mailing list