New submission from Serhiy Storchaka:

A long time Tcl got support first 64-bit integers, and then arbitrary size 
integers. Python also supports arbitrary size integers. However Tkinter 
supports only C long integers. For example, on 32-bit platform:

>>> import tkinter
>>> t = tkinter.Tk()
>>> t.tk.call('expr', 2**30)
1073741824
>>> t.tk.call('expr', 2**31)
<wideInt object at 0x9122518>
>>> t.tk.call('expr', 2**63)
<bignum object at 0x9126010>

Those <wideInt object> and <bignum object> are not usable from Python. 
Potentially this can cause errors in some rare circumstances.

I'm working on a patch, but was faced with a problem. Tcl provides functions 
for conversions between Bignum Tcl object and mp_int, but it does not provide 
all functions for conversions between mp_int and bytes sequence. Which is 
better, add libtommath library to CPython dependencies, or implement the 
missing functionality manually? Or may be use haxadecimal representation for 
conversions?

----------
assignee: serhiy.storchaka
components: Tkinter
messages: 178815
nosy: gpolo, serhiy.storchaka
priority: normal
severity: normal
stage: needs patch
status: open
title: Tkinter doesn't support large integers
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue16840>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to