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

tuple assignment d[1,2] = 5 fails using python 2.6 #223

Open
pyjsorg opened this issue Apr 27, 2012 · 3 comments
Open

tuple assignment d[1,2] = 5 fails using python 2.6 #223

pyjsorg opened this issue Apr 27, 2012 · 3 comments
Labels

Comments

@pyjsorg
Copy link
Contributor

pyjsorg commented Apr 27, 2012

diff --git a/examples/libtest/DictTest.py b/examples/libtest/DictTest.py
index 84a7e5e..53599a5 100644
--- a/examples/libtest/DictTest.py
+++ b/examples/libtest/DictTest.py
@@ -46,7 +46,8 @@ class DictTest(UnitTest):
#d[1,] = 2
d[(2,)] = 3
d[(1,1)] = 4

  •    d[1,2] = 5
    
  •    #d[1,2] = 5 # can't cope with more than one: thinks it's a slice.
    
  •                # see translator _assign ast.Subscript, OP_ASSIGN.
     v = {(1, 2): 5, 1: 1, (1, 1): 4, (2,): 3}
     self.assertTrue(d == v, "%r == %r" % (d, v))
    

Original issue: http://code.google.com/p/pyjamas/issues/detail?id=496 (September 22, 2010 11:44:40)

@pyjsorg
Copy link
Contributor Author

pyjsorg commented Apr 27, 2012

From dan.kl...@gmail.com on June 25, 2011 12:31:44:
This is part of slice protocol change, interpretation of value inside [] is up to collection instance now (setitem()), not the translator.
Should be fixed along #364, #577, #582

@pyjsorg
Copy link
Contributor Author

pyjsorg commented Apr 27, 2012

From dan.kl...@gmail.com on June 26, 2011 13:45:26:
Actually, this works fine with internal compiler. Still fails on d[1,], but at least there is no translation error.

@pyjsorg
Copy link
Contributor Author

pyjsorg commented Apr 27, 2012

From dan.kl...@gmail.com on June 26, 2011 13:58:26:
Aha, d[1,] is same as it was with cpython's compiler, just have to apply Kees's patches from #273 / http://bugs.python.org/issue6978

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

No branches or pull requests

1 participant