[issue869780] curselection() in Tkinter.py should return ints

2009-06-21 Thread Guilherme Polo
Guilherme Polo added the comment: Closing this in favour of issue6181 as it contains several other minor fixes in Listbox that now have been tested in the tk_and_idle_maintenance branch. -- status: open -> closed superseder: -> Tkinter.Listbox several minor issues

[issue869780] curselection() in Tkinter.py should return ints

2008-05-10 Thread Pedro Werneck
Changes by Pedro Werneck <[EMAIL PROTECTED]>: Removed file: http://bugs.python.org/file10252/issue869780.py Tracker <[EMAIL PROTECTED]> ___

[issue869780] curselection() in Tkinter.py should return ints

2008-05-10 Thread Guilherme Polo
Changes by Guilherme Polo <[EMAIL PROTECTED]>: Added file: http://bugs.python.org/file10260/curselection_tupleint.diff Tracker <[EMAIL PROTECTED]> _

[issue869780] curselection() in Tkinter.py should return ints

2008-05-10 Thread Guilherme Polo
Changes by Guilherme Polo <[EMAIL PROTECTED]>: Removed file: http://bugs.python.org/file10249/curselection_tupleint.diff Tracker <[EMAIL PROTECTED]> ___

[issue869780] curselection() in Tkinter.py should return ints

2008-05-10 Thread Guilherme Polo
Changes by Guilherme Polo <[EMAIL PROTECTED]>: Removed file: http://bugs.python.org/file10259/curselection_tupleint.diff Tracker <[EMAIL PROTECTED]> ___

[issue869780] curselection() in Tkinter.py should return ints

2008-05-10 Thread Guilherme Polo
Guilherme Polo <[EMAIL PROTECTED]> added the comment: I found some code using map(int, curselection..) directly, so this new patch fixes the problem related to returning None when nothing was selected. Added file: http://bugs.python.org/file10259/curselection_tupleint.diff _

[issue869780] curselection() in Tkinter.py should return ints

2008-05-10 Thread Guilherme Polo
Guilherme Polo <[EMAIL PROTECTED]> added the comment: Are you aware of any code checking against empty tuple specifically to verify that nothing is selected ? Tracker <[EMAIL PROTECTED]> ___

[issue869780] curselection() in Tkinter.py should return ints

2008-05-10 Thread Pedro Werneck
Pedro Werneck <[EMAIL PROTECTED]> added the comment: Neither I do, but the current version already returns an empty tuple. Since the map(int, curselection) idiom is widely used, changing to int is not likely to break any code, but returning None on empty selection is. ___

[issue869780] curselection() in Tkinter.py should return ints

2008-05-10 Thread Guilherme Polo
Guilherme Polo <[EMAIL PROTECTED]> added the comment: _getints already call splitlist, so there isn't much point in calling _getints after calling splitlist. And the Tk documentation says an empty string should be returned in case there is no selection, but that is Tk. I don't see any problem in

[issue869780] curselection() in Tkinter.py should return ints

2008-05-10 Thread Pedro Werneck
Pedro Werneck <[EMAIL PROTECTED]> added the comment: I used the tuple from splitlist() in both cases. I'm not sure if it should return None on an empty selection since that is not documented anywhere. Added file: http://bugs.python.org/file10252/issue869780.py __

[issue869780] curselection() in Tkinter.py should return ints

2008-05-10 Thread Pedro Werneck
Changes by Pedro Werneck <[EMAIL PROTECTED]>: Removed file: http://bugs.python.org/file10248/issue869780_3.patch Tracker <[EMAIL PROTECTED]> ___

[issue869780] curselection() in Tkinter.py should return ints

2008-05-10 Thread Pedro Werneck
Changes by Pedro Werneck <[EMAIL PROTECTED]>: Removed file: http://bugs.python.org/file10246/issue869780_2.6.patch Tracker <[EMAIL PROTECTED]> _

[issue869780] curselection() in Tkinter.py should return ints

2008-05-10 Thread Guilherme Polo
Guilherme Polo <[EMAIL PROTECTED]> added the comment: Not sure what you did, but calling _getints didn't raise an exception here neither returned an empty string if no item was selected, it returned None. Added file: http://bugs.python.org/file10249/curselection_tupleint.diff __

[issue869780] curselection() in Tkinter.py should return ints

2008-05-10 Thread Pedro Werneck
Changes by Pedro Werneck <[EMAIL PROTECTED]>: Added file: http://bugs.python.org/file10248/issue869780_3.patch Tracker <[EMAIL PROTECTED]> _

[issue869780] curselection() in Tkinter.py should return ints

2008-05-10 Thread Pedro Werneck
Pedro Werneck <[EMAIL PROTECTED]> added the comment: Just a bare self._getints will raise an exception with no item selected and an empty string returned, so I'm adding a patch to check for it and return an empty tuple in that case, or the tuple with ints. It's open for discussion if we should f

[issue869780] curselection() in Tkinter.py should return ints

2008-04-04 Thread Guilherme Polo
Guilherme Polo <[EMAIL PROTECTED]> added the comment: Indeed, it should call self._getints, not sure why it was never done. Fixing this gives curselection the correct behavior according to the Tk Reference Manual: http://tmml.sourceforge.net/doc/tk/listbox.html -- nosy: +gpolo _