Roundup Robot added the comment:
New changeset eb1734e579f7 by Chris Jerdonek in branch '2.7':
Issue #16790: add some of the recent issue #16045 int tests to test_long.
http://hg.python.org/cpython/rev/eb1734e579f7
--
___
Python tracker
Anton Kasyanov added the comment:
looks good to me
--
nosy: +asvetlov, mindmaster
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16045
___
___
Roundup Robot added the comment:
New changeset c502a2dc0345 by Andrew Svetlov in branch '2.7':
Issue #16045: add more unit tests for built-in int()
http://hg.python.org/cpython/rev/c502a2dc0345
New changeset a90d7003966e by Andrew Svetlov in branch '3.3':
Issue #16045: add more unit tests for
Andrew Svetlov added the comment:
Committed. Thanks.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16045
___
___
Python-bugs-list mailing list
Changes by Andrew Svetlov andrew.svet...@gmail.com:
--
resolution: - fixed
stage: patch review - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16045
Chris Jerdonek added the comment:
Adding patch modified for 2.7. Here are the differences I found from 3.3.
Unlike 3.3--
(1) 2.7 does not accept bytearrays for x (though it accepts str/bytes).
(2) 2.7 raises a TypeError if passed a string base without providing x.
Is it acceptable to add
Chris Jerdonek added the comment:
Attaching first version of patch. Interestingly, not all of these pass when I
tried applying to 2.7. For example,
int(base='foo')
Traceback (most recent call last):
File stdin, line 1, in module
TypeError: an integer is required
So at least one
Chris Jerdonek added the comment:
From http://bugs.python.org/review/16036/ for issue 16036:
Somewhere should be exposed that x must be str, bytes, bytearray or a
subclass.
We can add tests for this, too (if not already there).
--
___
Python
Chris Jerdonek added the comment:
[Reopening] Actually, there may still be value in this. Not all of the edge
cases I mentioned are covered (e.g. calling using keyword arguments).
--
resolution: invalid -
stage: committed/rejected - test needed
status: closed - open
title: create
Chris Jerdonek added the comment:
We should also add a code-comment pointer in test_builtin to test_int (where
test_int() would be located).
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16045
Ezio Melotti added the comment:
Before adding tests (and possibly documentation) for edge cases like
int(base='foo') # no exception; returns 0
I'd take a look at what other implementations do. If they do something
different we might still decide to keep the tests and mark them as
Chris Jerdonek added the comment:
Good thought. Here is one data point:
$ pypy
Python 2.7.2 (341e1e3821fff77db3bb5cdb7a4851626298c44e, Jun 09 2012, 14:24:11)
[PyPy 1.9.0] on darwin
Type help, copyright, credits or license for more information.
int()
0
int(x='10', base=8)
8
int(x=5, base=10)
12 matches
Mail list logo