Created on 2018-03-24 18:16 by levkivskyi, last changed 2018-03-25 09:21 by levkivskyi.
Messages (3) | |||
---|---|---|---|
msg314378 - (view) | Author: Ivan Levkivskyi (levkivskyi) * ![]() |
Date: 2018-03-24 18:16 | |
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 https://github.com/python/typing/issues/275, I think at least at runtime we should not do this. |
|||
msg314395 - (view) | Author: Guido van Rossum (gvanrossum) * ![]() |
Date: 2018-03-25 05:39 | |
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 yet, and without that option, mypy treats the type as Optional[int]. |
|||
msg314401 - (view) | Author: Ivan Levkivskyi (levkivskyi) * ![]() |
Date: 2018-03-25 09:21 | |
OK, let us then keep this issue as a remainder that we need to update the runtime behaviour when the static one changes. |
History | |||
---|---|---|---|
Date | User | Action | Args |
2018-03-25 09:21:10 | levkivskyi | set | messages: + msg314401 |
2018-03-25 05:39:44 | gvanrossum | set | messages: + msg314395 |
2018-03-24 18:16:02 | levkivskyi | create |