Terry J. Reedy added the comment:
The bbox fix and the return change are unrelated issues. Let us separate them.
There are bbox methods for Grid, Canvax, Listbox, Text, and Spinbox. All are
documented as returning tuples of (4) ints, though there are two different
interpretations. The first 4 end with
return self._getints(self.tk.call(...)) or None
Spinbox.bbox should be fixed in all versions to do the same. (The current patch
leave off 'or None'. I am not sure if it is ever 'triggered', but let's be
consistent.) The new test looks good. I thought of checking that they are all
non-negative, but that would really be a tk test and would not catch tk being
off by 1, which I think is more likely than tk completely blundering by
returning a negative int.
Grepping tkinter.__init__.py for 'an empty string' gives multiple hits that
indicate to me (without detailed examination) that there are about 7 methods
that return such. This is slightly odd in a Python context, but it is
documented, hence not wrong. It does not seem to cause a problem; hence it
should only be changed in the future after a deprecation period. (At least, I
would not do so without pydev discussion, even though no sane code I can think
of other than a complete test should depend on the return.) Moreover, no
deprecation warning would be possible. So I would reject the idea unless
someone wants to open a new issue and examine all such returns for possible
change in Python 4.
Anyway, I removed '' returns from the title to make this issue just about
Spinbox.bbox. With the patch (and news item) limited to bbox and its test and
'or None' added, I think this would be ready to push.
--
title: Tkinter.Spinbox: fix for bbox and removed some uninteresting returns -
Tkinter.Spinbox: fix bbox method
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6160
___
___
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com