Mark Dickinson dicki...@gmail.com added the comment:
For py3k, this was fixed in r81557.
--
nosy: +mark.dickinson
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2844
___
Changes by Facundo Batista [EMAIL PROTECTED]:
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2844
__
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Jakub Wilk [EMAIL PROTECTED]:
int('42', 42)
Traceback (most recent call last):
File stdin, line 1, in module
ValueError: int() base must be = 2 and = 36
int('42', -909)
42
--
components: Library (Lib)
messages: 66777
nosy: jwilk
severity: normal
status: open
Simon Cross [EMAIL PROTECTED] added the comment:
Some quick digging in the code on trunk has revealed that by the time
the base reaches PyInt_FromString in intobject.c, -909 has become 10.
Surrounding numbers seem to come through fine.
--
nosy: +hodgestar
Simon Cross [EMAIL PROTECTED] added the comment:
In int_new in intobject.c the base -909 is used to indicate that no base
has been passed through (presumably because NULL / 0 is a more common
pitfall that -909). Thus -909 is equivalent to base 10.
__
Tracker
Alexander Belopolsky [EMAIL PROTECTED] added the comment:
The same issue is present in long_new:
long('42', -909)
42L
I don't see why any magic value is needed, 10 would do the trick.
--
nosy: +belopolsky
__
Tracker [EMAIL PROTECTED]
Jakub Wilk [EMAIL PROTECTED] added the comment:
10 would *not* do the trick:
int(42)
42
int(42, 10)
Traceback (most recent call last):
File stdin, line 1, in module
TypeError: int() can't convert non-string with explicit base
__
Tracker [EMAIL PROTECTED]
Changes by Alexander Belopolsky [EMAIL PROTECTED]:
--
keywords: +patch
Added file: http://bugs.python.org/file10316/issue2844.diff
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2844
__
Changes by Alexander Belopolsky [EMAIL PROTECTED]:
--
versions: +Python 2.6, Python 3.0
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2844
__
___
Python-bugs-list
Changes by Alexander Belopolsky [EMAIL PROTECTED]:
Removed file: http://bugs.python.org/file10317/issue2844-1.diff
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2844
__
___
Changes by Alexander Belopolsky [EMAIL PROTECTED]:
Removed file: http://bugs.python.org/file10318/issue2844-1.diff
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2844
__
___
Changes by Alexander Belopolsky [EMAIL PROTECTED]:
Added file: http://bugs.python.org/file10319/issue2844-1.diff
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2844
__
___
Martin v. Löwis [EMAIL PROTECTED] added the comment:
I don't see the problem at all. The -909 value is an implementation
artefact, and the submitter probably wouldn't have known it existed
without reading the source code. Perhaps we should change it to
something different every Python release
13 matches
Mail list logo