8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4a7ad17 commit 7ac88d9Copy full SHA for 7ac88d9
py/dict.go
@@ -37,3 +37,23 @@ func (d StringDict) Copy() StringDict {
37
}
38
return e
39
40
+
41
+func (d StringDict) M__getitem__(key Object) Object {
42
+ str, ok := key.(String)
43
+ if ok {
44
+ res, ok := d[string(str)]
45
46
+ return res
47
+ }
48
49
+ panic(ExceptionNewf(KeyError, "%v", key))
50
+}
51
52
+func (d StringDict) M__setitem__(key, value Object) Object {
53
54
+ if !ok {
55
+ panic("FIXME can only have string keys!")
56
57
+ d[string(str)] = value
58
+ return None
59
0 commit comments