Support functions for callable protocols and typing aliases, plus a talks and articles page - #963
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #963 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 28 28
Lines 9162 9209 +47
=========================================
+ Hits 9162 9209 +47 ☔ View full report in Codecov by Harness. |
|
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.



What does this PR do?
Improvements to protocol and
Callabletype support, fixes for unsubscriptedtypingaliases, and documentation restructuring.Added
__call__is now also implemented by a function with a compatible signature, so the import path of a function is accepted as value. The value is then the function itself, instead of a class to instantiate.--*.helpfor such a value gives a clear error, since a function has no class to describe.Fixes #616
Fixed
time.localtime, were rejected forCallabletypes with a class return type. Now the return type from a.pyiis used when the stubs resolver is enabled.typingsequence aliases (List,Sequence,MutableSequence,Iterable,Collection,Container,ReversibleandDeque) raisedAttributeError: __args__, which made classes that have one in their signature, e.g.torch.utils.data.DataLoader, impossible to add.typing.Hashableandtyping.Sizedwere not supported, while thecollections.abcspelling of the same types was. A bare one didn't validate and a composed one, e.g.Optional[Hashable], raisedUnsupported type hint.Documentation
talks-and-articlescollecting presentations, videos, blog posts and example projects, replacing the shorter Tutorials section inDOCUMENTATION.rst. Linked from the README and fromCONTRIBUTING.rst.auto_clidocstring, where it is more discoverable.CONTRIBUTING.rstrephrased for conciseness.Callabletypes.Before submitting