-
Notifications
You must be signed in to change notification settings - Fork 263
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
Add Py3.4 support. #20
Open
darius
wants to merge
13
commits into
nedbat:master
Choose a base branch
from
darius:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
06f0f94
Get comprehensions to work in Python 3.4. Since the function name may…
darius 28a8165
Make the LOAD_BUILD_CLASS opcode roughly work in Py3.4. It was comple…
darius a2214f6
Simpler code.
darius 2190231
Make the NameError message match Py3's if PY3.
darius fcea67e
add py34 to tox.ini
darius 6be1064
Use a noncapturing regex since we don't need to capture.
darius 4c90233
Remove func_locals from Function: it's not used and doesn't seem to b…
darius 70727da
Add a failing test for issue #17.
darius 83699af
Pass fn.func_closure into new frames, and initialize cells using it. …
darius 90f028e
Populate the global environment for running tests in real Python for …
darius 9541a71
Fill in build_class with the metaclass logic (following the CPython i…
darius 86c702b
add to AUTHORS
darius 31d4e46
simplify popping from kwds
darius File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ Paul Swartz | |
Ned Batchelder | ||
Allison Kaptur | ||
Laura Lindzey | ||
Darius Bacon |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@darius I like this test. I've added it in my fork here rocky@e4782c0
What I like about this kind of test is that it simplifies testing. Instead of comparing output in the test runner, all the test runner has to do is run the program and the execution of the program tests itself.
And that way you can simply run the interpeter without any test framework to see if the issue is resoved. Real simple.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've gotten around to studying why this test fails and it uncovers a fundamental flaw with how opcode arguments are passed in the current design, at least for "freeops" I think. Lacking a better place, I'll note it here.
It may be a while before I fix it in x-python.
The "deref" opcodes like
LOAD_DEREF
, also known as opcodes in thehasfree[]
opcodes list, are passed a string name, but in the Python reference library of course, the operand is really an integer index.In this inerpreter, the frame cells are a dictionary whereas in CPython frame cells are an array.
Normally, everything is fine because names are distinct. For example, you can't have two local variables called
a
. But in the cells array, names don't have to be distinct.In particular in this test, the variable
xs
appears in two scopes. So when aLOAD_DEREF
does its lookup into a dictionary, it finds the wrong value since the dictonary can only have one key with valuexs
.