Terry J. Reedy added the comment:
A minor change. Complete the path by adding the other var-trace pairs and
after checking carefully, I will be ready to push.
I prefer one easy to remember short-name function to two longer-named
functions. However, the docstring should specify the tuple as idleConf
config-type, section, and option names. Either *add* or *make_callback* could
check len = 3 and callback[0] in idleConf.config_types, with a test added.
"changing the existing code seemed a little hackish": I don't understand
exactly what you think is hackish.
There might be people who would prefer (possibly as less hakish)
def add(tkvar, parent, cb_info):
var = tkvar(parent)
if isinstance(callback, tuple):
callback = self.make_callback(var, cb_info)
else:
callback = cb_info
self.untraced.append((var, callback))
return var
I don't know if this would make the add calls readable, but is does factor the
var calls into one place, replaces () with ',' (at the cost of passing one more
reference), and avoids the hackish return of an input. It also simplifies the
code in a way by making it 'flatter' instead of nested. Did I miss something?
What do you think?
The parameter name change is an independent idea that should satisfy someone
who objects to calling something an x that is not an x.
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue30853>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com