Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

String multiplication is non-commutative #20

Closed
GoogleCodeExporter opened this issue May 27, 2015 · 4 comments
Closed

String multiplication is non-commutative #20

GoogleCodeExporter opened this issue May 27, 2015 · 4 comments

Comments

@GoogleCodeExporter
Copy link

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
Copy link
Author

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
Copy link
Author

Added a test case.

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

Attachments:

@GoogleCodeExporter
Copy link
Author

You may apply this patch to the trunk.

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

@GoogleCodeExporter
Copy link
Author

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

  • Changed state: Verified

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant