ENH: Improve the placeholder annotations for the main numpy namespace#18765
Merged
charris merged 5 commits intonumpy:mainfrom Apr 13, 2021
Merged
ENH: Improve the placeholder annotations for the main numpy namespace#18765charris merged 5 commits intonumpy:mainfrom
charris merged 5 commits intonumpy:mainfrom
Conversation
added 5 commits
April 13, 2021 17:18
e.g. types and instances
It has been deprecated and removed for quite some time
Member
|
Thanks Bas. Is there any way to break some of the long lines in some of the annotations? |
Member
Author
|
Sure, especially with the bigger functions (e.g. |
16 tasks
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 improves the placeholder type annotations for the main numpy namespace,
namelly to provide something a bit more oncrete than just plain
Any.The improvements can be divided into four general categories:
ScalarType): Have been fully annotated.iinfo): Have been annotated asType[Any].angle): Have been replaced with proper (unannotated) functions, constructed with the help ofinspect.signature.arange): Have been annotated asCallable[..., Any]as we can't (ab)useinspect.signaturehere.Applying similar improvements to the various other namespaces is considered beyond the scope of this PR and
reserved for future work.