Comments (5)
I think 1 sounds good. What if some of the arguments are not annotated?
from typing.
I always assumed this would be (1), because "unannotated" means "Any" in
general.
On Thu, Jan 15, 2015 at 7:16 AM, Andrey Vlasovskikh <
[email protected]> wrote:
I think 1 sounds good. What if some of the arguments are not annotated?
—
Reply to this email directly or view it on GitHub
#37 (comment).
--Guido van Rossum (python.org/~guido)
from typing.
Okay, 1 is reasonable and how it currently works in mypy. Maybe the examples in the PEP should be modified to include the return value type, even if it's None
? Otherwise, it may give the impression that leaving out the return type is generally the right thing to do, even though statically typed code generally should explicitly define return types, as the implicit Any
types limit the type checker's effectiveness.
from typing.
Agreed, the PEP should only show fully-annotated examples, except where explaining what leaving out annotations means.
from typing.
Looks like a duplicate of #65
from typing.
Related Issues (20)
- Support for Union[*TypeVarTuple] HOT 3
- (Partial) keyword argument forwarding HOT 1
- Type hinting a class decorator that returns a subclass
- Typing spec: Improve cross-linking HOT 1
- Spec: Mandate support for typing-extensions
- Make support for type comments optional HOT 3
- Typing spec: More consistent, formalized language HOT 3
- Specify how type checkers should interpret `__exit__` annotations HOT 2
- Annotations for `__eq__`
- Switch to `main`? HOT 5
- how do I pass down the Class type to a method without using it as a parameter HOT 1
- Spec: Specify how inheriting from Any works HOT 2
- Specify what happens for binary operators (e.g. `__add__`) HOT 3
- Specify NamedTuple HOT 2
- Allow unary `+` in integer Literals HOT 1
- Pass variable as final HOT 4
- Spec: Allow `NoReturn` to appear outside of function return type annotations HOT 6
- Treat alternative syntax for unions (and other "new-semantics-old-syntax" typing features) in explicit `TypeAlias`es inside `if TYPE_CHECKING` blocks as stringized annotations. HOT 6
- Spec: Annotating the `self` argument in `__init__` methods HOT 17
- FYI: I removed the "stable" docs version
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from typing.