[Python-ideas] PEP 484 (Type Hints) -- first draft round
Ed Kellett
edk141 at gmail.com
Thu Jan 22 16:10:13 CET 2015
On Thu Jan 22 2015 at 14:53:56 Brett Cannon <brett at python.org> wrote:
>
> If you read one of Ed's earlier emails it sounds like he thinks you need
> the @no_type_hints decorator even if you don't provide *any* annotations,
> which is incorrect (the decorator is only to signal that annotations you
> did specify are not type hints; not specifying any annotations signals the
> same thing). Heck, the decorator isn't even technically necessary if the
> linter or IDE you are using that can process the type hints chooses to
> treat unrecognized annotations as Any instead of throwing an error or
> something.
>
I feel like I've been significantly misunderstood. To be clear, I'm talking
about using @no_type_checks or whatever the decorator is called for code I
have that *already uses annotations*.
Type checking will either fail, or become ubiquitous to the point that
passing type checking is a prerequisite to being considered "good" for any
Python module. Should the latter happen, I'll have to break my code for
past or future Python versions, no?
Personally, I'd like to believe that this proposal and the echochamber
that's surrounded it has all been just a bad dream, but given that it's
almost certainly going to make it into Python at this point, it'd be nice
not to have to make good code bad just to maintain compatibility with it.
Since type hints already depend on the 'typing' module anyway, what exactly
would be wrong with the type checker defaulting off unless it is imported?
Ed Kellett
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150122/170f0028/attachment.html>
More information about the Python-ideas
mailing list