forked from skulpt/skulpt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request skulpt#44 from csev/master
Issues 40 and 42 - Improve open() message, make list() and dict() work.
- Loading branch information
Showing
8 changed files
with
203 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
l = list() | ||
print l | ||
l.append(1) | ||
print l | ||
d = dict() | ||
print d | ||
d["zap"] = 1 | ||
print d | ||
|
||
# Make sure this still works | ||
l2 = list(l) | ||
print l2 | ||
|
||
l3 = list(d) | ||
print l3 | ||
|
||
# It would be nice to make this work | ||
# But that would be a separate issue | ||
# d2 = dict(d.items()) | ||
# print d2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[] | ||
[1] | ||
{} | ||
{'zap': 1} | ||
[1] | ||
['zap'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
Sym_type: module | ||
Sym_name: top | ||
Sym_lineno: 0 | ||
Sym_nested: False | ||
Sym_haschildren: False | ||
-- Identifiers -- | ||
name: d | ||
is_referenced: True | ||
is_imported: False | ||
is_parameter: False | ||
is_global: False | ||
is_declared_global: False | ||
is_local: True | ||
is_free: False | ||
is_assigned: True | ||
is_namespace: False | ||
namespaces: [ | ||
] | ||
name: dict | ||
is_referenced: True | ||
is_imported: False | ||
is_parameter: False | ||
is_global: True | ||
is_declared_global: False | ||
is_local: False | ||
is_free: False | ||
is_assigned: False | ||
is_namespace: False | ||
namespaces: [ | ||
] | ||
name: l | ||
is_referenced: True | ||
is_imported: False | ||
is_parameter: False | ||
is_global: False | ||
is_declared_global: False | ||
is_local: True | ||
is_free: False | ||
is_assigned: True | ||
is_namespace: False | ||
namespaces: [ | ||
] | ||
name: l2 | ||
is_referenced: True | ||
is_imported: False | ||
is_parameter: False | ||
is_global: False | ||
is_declared_global: False | ||
is_local: True | ||
is_free: False | ||
is_assigned: True | ||
is_namespace: False | ||
namespaces: [ | ||
] | ||
name: l3 | ||
is_referenced: True | ||
is_imported: False | ||
is_parameter: False | ||
is_global: False | ||
is_declared_global: False | ||
is_local: True | ||
is_free: False | ||
is_assigned: True | ||
is_namespace: False | ||
namespaces: [ | ||
] | ||
name: list | ||
is_referenced: True | ||
is_imported: False | ||
is_parameter: False | ||
is_global: True | ||
is_declared_global: False | ||
is_local: False | ||
is_free: False | ||
is_assigned: False | ||
is_namespace: False | ||
namespaces: [ | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
Module(body=[Assign(targets=[Name(id='l', | ||
ctx=Store())], | ||
value=Call(func=Name(id='list', | ||
ctx=Load()), | ||
args=[], | ||
keywords=[], | ||
starargs=None, | ||
kwargs=None)), | ||
Print(dest=None, | ||
values=[Name(id='l', | ||
ctx=Load())], | ||
nl=True), | ||
Expr(value=Call(func=Attribute(value=Name(id='l', | ||
ctx=Load()), | ||
attr='append', | ||
ctx=Load()), | ||
args=[Num(n=1)], | ||
keywords=[], | ||
starargs=None, | ||
kwargs=None)), | ||
Print(dest=None, | ||
values=[Name(id='l', | ||
ctx=Load())], | ||
nl=True), | ||
Assign(targets=[Name(id='d', | ||
ctx=Store())], | ||
value=Call(func=Name(id='dict', | ||
ctx=Load()), | ||
args=[], | ||
keywords=[], | ||
starargs=None, | ||
kwargs=None)), | ||
Print(dest=None, | ||
values=[Name(id='d', | ||
ctx=Load())], | ||
nl=True), | ||
Assign(targets=[Subscript(value=Name(id='d', | ||
ctx=Load()), | ||
slice=Index(value=Str(s='zap')), | ||
ctx=Store())], | ||
value=Num(n=1)), | ||
Print(dest=None, | ||
values=[Name(id='d', | ||
ctx=Load())], | ||
nl=True), | ||
Assign(targets=[Name(id='l2', | ||
ctx=Store())], | ||
value=Call(func=Name(id='list', | ||
ctx=Load()), | ||
args=[Name(id='l', | ||
ctx=Load())], | ||
keywords=[], | ||
starargs=None, | ||
kwargs=None)), | ||
Print(dest=None, | ||
values=[Name(id='l2', | ||
ctx=Load())], | ||
nl=True), | ||
Assign(targets=[Name(id='l3', | ||
ctx=Store())], | ||
value=Call(func=Name(id='list', | ||
ctx=Load()), | ||
args=[Name(id='d', | ||
ctx=Load())], | ||
keywords=[], | ||
starargs=None, | ||
kwargs=None)), | ||
Print(dest=None, | ||
values=[Name(id='l3', | ||
ctx=Load())], | ||
nl=True)]) |