[Python-Dev] Please reject or postpone PEP 526 (original) (raw)

Steven D'Aprano steve at pearwood.info
Sun Sep 4 07:51:59 EDT 2016


On Sun, Sep 04, 2016 at 12:31:26PM +0100, Mark Shannon wrote:

In other words PEP 484 specifically states that annotations are to help with type inference. As defined in PEP 526, I think that type annotations become a hindrance to type inference.

I'm pretty sure that they don't.

Have you used any languages with type inference? Any type-checkers? If so, can you give some actual concrete examples of how annotating a variable hinders type inference? It sounds like you are spreading FUD at the moment.

The whole point of type annotations is that you use them to deliberately over-ride what the checker would infer (if it infers the wrong thing, or cannot infer anything). I cannot see how you conclude from this that type annotations will be a hindrance to type inference.

If you don't want to declare the type of a variable, simply DON'T declare the type, and let the checker infer whatever it can (which may be nothing, or may be the wrong type).

-- Steve



More information about the Python-Dev mailing list