You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If anyone feels like working on this, in principle I'm open to suitably scoped PRs adding type signatures to parts of the library (using Python's type annotations) - but perhaps post a comment here for discussion first, to converge on a definition for "suitably scoped".
The text was updated successfully, but these errors were encountered:
Forgot to mention, this allows us to delete not only the isinstance boilerplate that performs runtime type checking, but also the automated tests for individual instances of that boilerplate. The @typed machinery is tested centrally, so we can rely on it.
This is one reason it's useful to have a gradual typing mechanism (using some kind of type annotations) as a language feature in a dynamically typed language... sure, one can achieve the same effect in any Turing-complete language even without such a mechanism, as Python programs often do, but having a mechanism to compactly express this very common intent makes programs shorter, and more readable.
(Having language support reduces the impedance mismatch between what the source code says and what the programmer means. Arguably, the types are part of the call signature, so the logical place to express the type check is as part of the function's API; not hidden inside the function body so one has to look at the implementation (or at the docstring).)
While useful, this is difficult to do for features like
curry
andwith continuations
.Some selected parts of
unpythonic
could be eventually gradually typed using mypy, but this is not being worked on at the moment.See #8 for context.
If anyone feels like working on this, in principle I'm open to suitably scoped PRs adding type signatures to parts of the library (using Python's type annotations) - but perhaps post a comment here for discussion first, to converge on a definition for "suitably scoped".
The text was updated successfully, but these errors were encountered: