[issue33133] Don't return implicit optional types by get_type_hints

2018-03-25 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: OK, let us then keep this issue as a remainder that we need to update the runtime behaviour when the static one changes. -- ___ Python tracker

[issue33133] Don't return implicit optional types by get_type_hints

2018-03-24 Thread Guido van Rossum
Guido van Rossum added the comment: I'm not sure we should change this ahead of a definitive decision. When you use mypy with the option that forbids it, your program will be invalid, and it doesn't really matter what we do at runtime; but that option is not the default

[issue33133] Don't return implicit optional types by get_type_hints

2018-03-24 Thread Ivan Levkivskyi
New submission from Ivan Levkivskyi : Currently this code def f(x: int = None): pass get_type_hints(f) returns {'x': Optional[int]}. I propose to abandon this behaviour. Although there is not yet a definitive decision about this aspect of PEP 484, see