[issue6167] Tkinter.Scrollbar: the activate method needs to return a value, and set should take only two args
Jim Jewett
report at bugs.python.org
Sat Apr 7 00:45:31 CEST 2012
Jim Jewett <jimjjewett at gmail.com> added the comment:
(1) Why did you change the name of the parameter from index to element? If the underlying engine also accepts indices (e.g., self.activate(4) ) then the name should stay. If it really is only meaningful to use the name of an element -- maybe it should still stay for backwards compatibility. Or at least accept the old name too for a release.
Either way, please provide a test case showing that it works under the new name; there may also be doc fixes. (I'm not sure there is documentation for this widget, though, and providing some in the first place is good, but perhaps a different task.)
FWIW,
http://docs.python.org/dev/library/tkinter.html#the-index-parameter
suggests that the name should stay index, and can be far more than an element; migrating some of that to the docstring might be helpful.
(2) It looks like the set command took *args to give some freedom. There may be extensions that take a third argument. It may well be valid to call it without any arguments, or with only one. So the signature may turn into set(first=0, last=1, *args) or some such. Whatever the answer about what arguments are really needed, there should be test cases to demonstrate this before the API is changed.
----------
nosy: +Jim.Jewett
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6167>
_______________________________________
More information about the Python-bugs-list
mailing list