Message166908
The exact same issue happens when concatenating a list subclass to a tuple:
>>> () + L([1,2])
[1, 2]
>>> (3,) + L([1,2])
# crash
Also, note that in this case a list is returned, not a tuple despite the first operand being a tuple. Conversely:
>>> [] + T((1,2))
(1, 2)
A tuple is returned, not a list. Which is exactly what happens when calling T.__add__:
>>> T.__add__((), T((1,2)))
(1, 2)
My intuition is that the issue is somewhere in binary_op1() (called by PyNumber_Add) in abstract.c. I can't go much further since my own builds don't exhibit the issue.
(in the end, chances are it's a MSVC compiler bug) |
|
Date |
User |
Action |
Args |
2012-07-30 16:30:56 | pitrou | set | recipients:
+ pitrou, loewis, rhettinger, terry.reedy, ishimoto, amaury.forgeotdarc, jackdied, tim.golden, eric.araujo, mrabarnett, r.david.murray, brian.curtin, benrg |
2012-07-30 16:30:56 | pitrou | set | messageid: <1343665856.86.0.759867022952.issue8847@psf.upfronthosting.co.za> |
2012-07-30 16:30:56 | pitrou | link | issue8847 messages |
2012-07-30 16:30:55 | pitrou | create | |
|