msg178043 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) * |
Date: 2012-12-24 10:16 |
Currently int() ignores base keyword argument if first string argument omitted. Such usage is no other than bug. The proposed patch raises TypeError in such case.
See also discussion at Python-Dev: http://comments.gmane.org/gmane.comp.python.cvs/92290 .
|
msg178044 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) * |
Date: 2012-12-24 10:19 |
In additional some int creation tests backported to old Python versions.
|
msg178097 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) * |
Date: 2012-12-24 20:22 |
Patches updated to address Cris's comments on Rietveld (thank you, Cris, for
review). In additional new tests added. I think merging test_int and test_long
is hard task and should be done in separated issue. Instead I have merged and
simplified some test to make synchronization simpler.
Two new possible bugs were found during working on these tests (issue16772 and
issue16773).
|
msg178100 - (view) |
Author: Chris Jerdonek (chris.jerdonek) * |
Date: 2012-12-24 21:13 |
This is good work. Thanks.
> I think merging test_int and test_long is hard task and should be done in separated issue.
I meant "share" rather than "merge." For the tests you're adding, isn't it simply a matter of putting the test cases into a separate mixin or TestCase class in a different module, and then importing and subclassing that (and setting the type to use as an attribute of the subclass)? Or am I missing something?
|
msg178186 - (view) |
Author: Gregory P. Smith (gregory.p.smith) * |
Date: 2012-12-26 06:43 |
Having just looked added something to test_int as part of issue16772... There appears to be an explicit test _for_ this strange behavior in there:
http://hg.python.org/cpython/file/60f7197f991f/Lib/test/test_int.py#l233
test_base_arg_with_no_x_arg
I have no idea why this exists or was desired.
|
msg178187 - (view) |
Author: Chris Jerdonek (chris.jerdonek) * |
Date: 2012-12-26 06:45 |
See this thread:
http://mail.python.org/pipermail/python-dev/2012-December/123283.html
|
msg178192 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) * |
Date: 2012-12-26 09:15 |
Sharing only those tests is not enough. We must revise all tests and extract common code to the separated class. I think this is too large change and unrelated to this issue. I will open a new issue for int tests enhancement and refactoring.
|
msg178193 - (view) |
Author: Chris Jerdonek (chris.jerdonek) * |
Date: 2012-12-26 09:40 |
It's enough not to make the problem worse, which is why I suggested it and what I wanted to avoid. If you copy-paste the tests you're adding now, it worsens the problem and makes it that much more tedious to fix later on (and to maintain in the meantime).
Why must the code sharing be all or nothing? Elsewhere we phase in improvements incrementally. Even with the particular refactoring you're suggesting for the future, I'm not sure we'd want to do it all in one patch.
If you begin the process now and add appropriate comments and TODO's pointing the way, at least the next person will know how to take the next steps.
|
msg178198 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) * |
Date: 2012-12-26 10:47 |
Here is a patches which contains only minimal set of required changes. Other
unrelated changes will be done in issue16784.
|
msg178199 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) * |
Date: 2012-12-26 10:57 |
Let's eat an elephant piece by piece. Only one issue per patch.
|
msg178202 - (view) |
Author: Chris Jerdonek (chris.jerdonek) * |
Date: 2012-12-26 11:22 |
Yes, it is a better approach. At first glance, the patches look okay to me.
|
msg178338 - (view) |
Author: Chris Jerdonek (chris.jerdonek) * |
Date: 2012-12-27 21:16 |
When this patch is updated because of the commit for issue 16790, in 3.x can the edited test cases be moved to the top of the test class per the following comment (as appropriate)?
http://bugs.python.org/issue16790#msg178282
As stated there, this will make synching tests between 2.7 and 3.x easier. We can do the others in 3.x whenever more are added to the 2.7 common tests.
|
msg178371 - (view) |
Author: Raymond Hettinger (rhettinger) * |
Date: 2012-12-28 07:29 |
I don't think a backport is appropriate for this kind of change.
|
msg178373 - (view) |
Author: Roundup Robot (python-dev) |
Date: 2012-12-28 08:20 |
New changeset c0266ba8e4c6 by Serhiy Storchaka in branch '2.7':
Issue #16761: Raise TypeError when int() or long() called with base argument only.
http://hg.python.org/cpython/rev/c0266ba8e4c6
New changeset e4ea38a92c4d by Serhiy Storchaka in branch '3.2':
Issue #16761: Raise TypeError when int() called with base argument only.
http://hg.python.org/cpython/rev/e4ea38a92c4d
New changeset 157ff02bcc16 by Serhiy Storchaka in branch '3.3':
Issue #16761: Raise TypeError when int() called with base argument only.
http://hg.python.org/cpython/rev/157ff02bcc16
New changeset 1b2134a78c17 by Serhiy Storchaka in branch 'default':
Issue #16761: Raise TypeError when int() called with base argument only.
http://hg.python.org/cpython/rev/1b2134a78c17
|
msg178374 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) * |
Date: 2012-12-28 08:28 |
> When this patch is updated because of the commit for issue 16790, in 3.x can the edited test cases be moved to the top of the test class per the following comment (as appropriate)?
I will do this in issue16784. In any case I am going to move a large part of test_basic/test_long to IntLongCommonTests and then those test will be above test_keyword_args.
|
msg178375 - (view) |
Author: Raymond Hettinger (rhettinger) * |
Date: 2012-12-28 09:08 |
Why did you backport this change after being advised not to do it?
|
msg178402 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) * |
Date: 2012-12-28 17:45 |
Sorry, I have not noticed your advice before I did commit (it took me a lot of time). Should I now revert my changes to 2.7, 3.2 and 3.3?
|
msg178414 - (view) |
Author: Antoine Pitrou (pitrou) * |
Date: 2012-12-28 18:58 |
If PyPy gets away with a different behaviour, there's probably nobody relying on it, so I'd say the backports are safe.
|
msg178427 - (view) |
Author: Raymond Hettinger (rhettinger) * |
Date: 2012-12-28 21:11 |
> Should I now revert my changes to 2.7, 3.2 and 3.3?
Once committed, I would say leave it in as long as you're confident that no currently working code will break as a result. In general, be very conservative about backporting any behavioral change.
|
|
Date |
User |
Action |
Args |
2022-04-11 14:57:39 | admin | set | github: 60965 |
2013-01-02 12:36:46 | serhiy.storchaka | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
2012-12-28 21:11:50 | rhettinger | set | messages:
+ msg178427 |
2012-12-28 18:58:19 | pitrou | set | nosy:
+ pitrou messages:
+ msg178414
|
2012-12-28 17:45:45 | serhiy.storchaka | set | messages:
+ msg178402 |
2012-12-28 09:08:48 | rhettinger | set | messages:
+ msg178375 |
2012-12-28 08:28:16 | serhiy.storchaka | set | messages:
+ msg178374 |
2012-12-28 08:20:59 | python-dev | set | nosy:
+ python-dev messages:
+ msg178373
|
2012-12-28 07:29:45 | rhettinger | set | nosy:
+ rhettinger
messages:
+ msg178371 versions:
- Python 2.7, Python 3.2, Python 3.3 |
2012-12-28 06:59:30 | serhiy.storchaka | set | assignee: serhiy.storchaka |
2012-12-27 21:16:16 | chris.jerdonek | set | messages:
+ msg178338 |
2012-12-26 11:22:03 | chris.jerdonek | set | messages:
+ msg178202 |
2012-12-26 10:57:19 | serhiy.storchaka | set | messages:
+ msg178199 |
2012-12-26 10:47:49 | serhiy.storchaka | set | files:
+ int_without_x-2.7_3.patch, int_without_x-3.2_3.patch, int_without_x-3.3_3.patch
messages:
+ msg178198 |
2012-12-26 10:40:01 | serhiy.storchaka | link | issue16784 dependencies |
2012-12-26 09:40:47 | chris.jerdonek | set | messages:
+ msg178193 |
2012-12-26 09:15:28 | serhiy.storchaka | set | messages:
+ msg178192 |
2012-12-26 06:45:32 | chris.jerdonek | set | messages:
+ msg178187 |
2012-12-26 06:43:36 | gregory.p.smith | set | nosy:
+ gregory.p.smith messages:
+ msg178186
|
2012-12-24 21:13:40 | chris.jerdonek | set | messages:
+ msg178100 |
2012-12-24 20:22:07 | serhiy.storchaka | set | files:
+ int_without_x-3.3_2.patch, int_without_x-3.2_2.patch, int_without_x-2.7_2.patch
messages:
+ msg178097 |
2012-12-24 10:24:34 | ezio.melotti | set | nosy:
+ ezio.melotti
|
2012-12-24 10:19:55 | serhiy.storchaka | set | files:
+ int_without_x-2.7.patch
messages:
+ msg178044 |
2012-12-24 10:17:59 | serhiy.storchaka | set | files:
+ int_without_x-3.2.patch nosy:
+ terry.reedy, asvetlov, chris.jerdonek
|
2012-12-24 10:16:19 | serhiy.storchaka | create | |