[issue3236] ints contructed from strings don't use the smallint constants

2012-12-26 Thread Benjamin Peterson
Benjamin Peterson added the comment: It's only an optimization, so no. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsu

[issue3236] ints contructed from strings don't use the smallint constants

2012-12-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Should it be backported to 2.7? -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-l

[issue3236] ints contructed from strings don't use the smallint constants

2008-06-29 Thread Martin v. Löwis
Martin v. Löwis <[EMAIL PROTECTED]> added the comment: This is now fixed in r64596. -- resolution: -> fixed status: open -> closed ___ Python tracker <[EMAIL PROTECTED]> ___ _

[issue3236] ints contructed from strings don't use the smallint constants

2008-06-29 Thread Antoine Pitrou
Antoine Pitrou <[EMAIL PROTECTED]> added the comment: Le dimanche 29 juin 2008 à 21:52 +, Martin v. Löwis a écrit : > Can you propose an implementation strategy that doesn't create the > object, yet still avoids duplication of large chunks of code? If by "duplicating large chunks of code", y

[issue3236] ints contructed from strings don't use the smallint constants

2008-06-29 Thread Martin v. Löwis
Martin v. Löwis <[EMAIL PROTECTED]> added the comment: > The bug entry is just for pointing out a missed optimization > opportunity. The first mentioned solution would already be an > improvement, although of course it would even be better to skip the > intermediary allocation altogether. Can yo

[issue3236] ints contructed from strings don't use the smallint constants

2008-06-29 Thread Antoine Pitrou
Antoine Pitrou <[EMAIL PROTECTED]> added the comment: Le dimanche 29 juin 2008 à 17:43 +, Martin v. Löwis a écrit : > For long, it's much more tricky, as no C type can be used to store the > intermediate result. So instead, PyLong_FromString already allocates a > sufficiently-sized long objec

[issue3236] ints contructed from strings don't use the smallint constants

2008-06-29 Thread Martin v. Löwis
Martin v. Löwis <[EMAIL PROTECTED]> added the comment: For the old int type, implementing this was trivial, as the conversion converted into a C long, then called PyInt_FromLong. For long, it's much more tricky, as no C type can be used to store the intermediate result. So instead, PyLong_FromSt

[issue3236] ints contructed from strings don't use the smallint constants

2008-06-29 Thread Benjamin Peterson
Benjamin Peterson <[EMAIL PROTECTED]> added the comment: I suspect this is because of the transition from PyInt to PyLong: Python 2.6b1+ (trunk:64580M, Jun 28 2008, 18:04:04) [GCC 4.0.1 (Apple Computer, Inc. build 5370)] on darwin Type "help", "copyright", "credits" or "license" for more informa

[issue3236] ints contructed from strings don't use the smallint constants

2008-06-29 Thread Antoine Pitrou
New submission from Antoine Pitrou <[EMAIL PROTECTED]>: The following says it all: >>> 1+1 is 2 True >>> int('2') is 2 False >>> int(b'2') is 2 False -- components: Interpreter Core messages: 68947 nosy: pitrou severity: normal status: open title: ints contructed from strings don't use