Fix #164, dylink import behavior for names that start with "_"#188
Open
aaaaalbert wants to merge 2 commits intoSeattleTestbed:masterfrom
Open
Fix #164, dylink import behavior for names that start with "_"#188aaaaalbert wants to merge 2 commits intoSeattleTestbed:masterfrom
aaaaalbert wants to merge 2 commits intoSeattleTestbed:masterfrom
Conversation
These tests try to illustrate Python's behavior on `import`ing or `from MODULE import *`ing a name that starts with an underscore (``_'') character, and check whether `dylink`'s corresponding functions `dy_import_module` and `dy_import_module_symbols` perform like their Python counterparts. The expected behavior is to * do import `module._underscorename`, but * don't add `_underscorename` via `from module import *` Alas, `dylink` doesn't conform currently: SeattleTestbed#164 .
This patch makes `dylink.r2py`'s import functions behave more
like their Python counterparts. Specifically,
* `dy_import_module_symbols` (akin to Python's `from MODULE import *`)
now correctly *skips* names that start with an underscort ("_"), and
* `dy_import_module` (akin to Python's `import MODULE`) now *does*
correctly import these names.
The new test cases supplied by the parent commit,
bb285e4 ,
thus all pass now.
Contributor
Author
|
See also the relevant post-merge test results for these tests (on a test branch of mine ATM), https://travis-ci.org/aaaaalbert/seattlelib_v2/jobs/155357118#L372-L375 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR proposes tests to highlight #164, and also a fix that makes
dylink's import functions behave like Python's. From the commit message of the ``fix'' part,