rsalmaso / tinypy

Automatically exported from code.google.com/p/tinypy
Other
0 stars 0 forks source link

String multiplication is non-commutative #20

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run the following code:

foo = 2 * "abc"
print(foo)

What is the expected output? What do you see instead?

Expected output:
"abcabc"

tinypy output:
"
File "baby.py", line 1, in ?
  foo = 2 * "abc"

Exception:
tp_mul(2,abc)
"

What version of the product are you using? On what operating system?

Slackware 12.1, Windows XP SP2.

Please provide any additional information below.

The issue is again in how tp_mul() checks for argument types. I would
provide a patch but I didn't want to patch both this and the issue 19 in
the same patch so I'm waiting until the patch for issue 19 gets committed.

Original issue reported on code.google.com by denis.ka...@gmail.com on 18 Jun 2008 at 7:26

GoogleCodeExporter commented 9 years ago
Here's a possible patch for the bug. I can't think of a way to simplify it any 
further.

Original comment by denis.ka...@gmail.com on 7 Aug 2008 at 4:54

Attachments:

GoogleCodeExporter commented 9 years ago
Added a test case.

Original comment by denis.ka...@gmail.com on 7 Aug 2008 at 8:42

Attachments:

GoogleCodeExporter commented 9 years ago
You may apply this patch to the trunk.

Original comment by philhas...@gmail.com on 5 Sep 2008 at 5:14

GoogleCodeExporter commented 9 years ago

Original comment by denis.ka...@gmail.com on 7 Sep 2008 at 1:36