-
-
Notifications
You must be signed in to change notification settings - Fork 414
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
Generic tree typing #967
Merged
Merged
Generic tree typing #967
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
b1ee70c
Make Tree generic & update releated classes
plannigan 9d1dcd4
Fixes to allow for building a wheel
plannigan 9c844c9
Improve type annotations related to TransformerChains
plannigan 862fb79
Clean up the internal annotations for Transformer_NonRecursive
plannigan f6b39d9
Clean up annotation for Interpreter
plannigan f6e1abe
Remove redundant generic typing of Any
plannigan 8a8b70d
Allow for TransformerChain to be used on the right side of the chain …
plannigan acf2a26
Make an alias for tree branches
plannigan 732143a
Reorder child type & return type
plannigan 1646426
Use Protocol instead of Union of Transformer tpes
plannigan c9c0140
Revert Protocol implmentation to avoid new dependency
plannigan 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
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
Js2Py==0.68 | ||
regex | ||
regex | ||
typing_extensions >= 3.7, < 5.0; python_version < "3.8" |
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.
Quick question: Why is it Leaf_U but Return_V? Do the U and V stand for something?
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.
The signature for the multiplication operator has a lot of moving pieces. It starts with a
ITransformer[_Leaf_T, Tree[_Leaf_U]]
instance (a transformer that converts aTree[_Leaf_T
] toTree[_Leaf_U]
). Then aITransformer[_Leaf_U, _Return_V]
instance (a transformer that converts aTree[_Leaf_U
] to_Return_V
). Which results in aITransformer[_Leaf_T, _Return_V]
(a transformer that converts aTree[_Leaf_T
] to_Return_V
).There isn't a technical reason why it needs to be named with
_Return_V
instead of_Return_U
. However, I was thinking that using_Return_V
would make it clearer that the final type isn't necessarily related to the intermediary_Leaf_U
. I'm open to switching to_Leaf_U
or putting some of my above description into a comment in the source code if you think the current state should be changed.