Handle non-uniform behaviour of __builtins__ #581
Merged
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.
Modifications:
According to https://docs.python.org/3.9/reference/executionmodel.html:
CPython implementation detail: Users should not touch builtins; it is strictly an implementation detail. Users wanting to override values in the builtins namespace should import the builtins module and modify its attributes appropriately.
The builtins namespace associated with the execution of a code block is actually found by looking up the name builtins in its global namespace; this should be a dictionary or a module (in the latter case the module’s dictionary is used). By default, when in the main module, builtins is the built-in module builtins; when in any other module, builtins is an alias for the dictionary of the builtins module itself.
This fix is needed to package scikit-network in nixpkgs (or at least to be able to remove the workaround)
Impacted submodules:
None
This pull request:
(your PR must match these criteria before review)
develop
branch