[issue23880] Tkinter: getint and getdouble should support Tcl_Obj

Serhiy Storchaka report at bugs.python.org
Tue Apr 7 10:41:04 CEST 2015


New submission from Serhiy Storchaka:

getint, getdouble and getboolean were thin wrappers around Tcl functions that converted string result of Tcl call to specified Python type. Since 2.3 _tkinter can return not only string, but int, float, etc and Tcl_Obj (if wantobject is True). getXXX methods was updated to work with respective automatically converted types (getint with int, etc), but they don't work with general Tcl_Obj, so can't be applied to the result of _tkinter call in general case. As a workaround you should use int(str(value)) or like.

Support of Tcl_Obj in getbool was added in issue15133. Proposed patch adds support of Tcl_Obj in getint and getdouble and int in getdouble. It also restores the use of getint and getdouble in Tkinter.

----------
components: Extension Modules, Tkinter
files: tkinter_getxxx_tclobj.patch
keywords: patch
messages: 240196
nosy: serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Tkinter: getint and getdouble should support Tcl_Obj
type: enhancement
versions: Python 3.5
Added file: http://bugs.python.org/file38855/tkinter_getxxx_tclobj.patch

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


More information about the Python-bugs-list mailing list