Repository navigation
Remove deferred imports from Shadow.PointerType - #7999
Merged
Merged
Conversation
Previously, Shadow.PointerType performed a deferred import of the `Shadow.cast` function in `__init__` and `__setitem__`. The `cast` function is defined at the module level and there are no conflicts with another `cast` function (like `typing.cast`) that would require shadowing the function. The imports also prevented users from copying the Shadow module [0] out with a different name. [0]: https://cython.readthedocs.io/en/latest/src/tutorial/pure.html#magic-attributes Signed-off-by: Vincent Fazio <vfazio@gmail.com>
vfazio
marked this pull request as ready for review
September 18, 2026 11:51
Collaborator
|
Looks sensible to me. I suspect it's a remnant of something else, but it's clearly no longer useful. |
Contributor
Author
I couldn't tease out why it was added in 6e31b41 since it wasn't in the pyi file... maybe the LLM thought it was necessary for some reason but i couldn't divine why We do use a full copy of the shadow file for some of our projects so merging this will allow us to copy it verbatim without edits. |
Contributor
Author
|
lmk if there's anything else I can help with on this PR. |
Contributor
|
Thanks |
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.
Previously, Shadow.PointerType performed a deferred import of the
Shadow.castfunction in__init__and__setitem__.The
castfunction is defined at the module level and there are no conflicts with anothercastfunction (liketyping.cast) that would require shadowing the function.The imports also prevented users from copying the Shadow module 0 out with a different name.