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

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

Projects

None yet

1 participant

@pyjsorg
Collaborator
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
Collaborator
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
Collaborator
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
Collaborator
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