[issue42169] Apparently all documentation on @typing.overload is wrong

2020-10-27 Thread Guido van Rossum
Change by Guido van Rossum : -- resolution: -> not a bug ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue42169] Apparently all documentation on @typing.overload is wrong

2020-10-27 Thread Peilonrayz
Peilonrayz added the comment: Thank you for the insight Guido. Sorry to be a bother everyone. -- resolution: not a bug -> versions: +Python 3.6, Python 3.7 ___ Python tracker ___

[issue42169] Apparently all documentation on @typing.overload is wrong

2020-10-27 Thread Guido van Rossum
Guido van Rossum added the comment: > The documentation for `typing.overload` says in a non-stub file the last > definition shouldn't be typed. Incorrect. It doesn't say it shouldn't be *typed*, it says it shouldn't be *decorated with @overload*, which is a different thing. The example is c

[issue42169] Apparently all documentation on @typing.overload is wrong

2020-10-27 Thread Ken Jin
Ken Jin added the comment: Apologies to all for the spam, I made a misclick. Maybe the documentation could be clearer for that specific example. The following code seems to work on mypy (in a non-stub file): ``` from typing import overload, Any, Optional @overload def utf8(value: None) -> N

[issue42169] Apparently all documentation on @typing.overload is wrong

2020-10-27 Thread Ken Jin
Change by Ken Jin : -- versions: +Python 3.6, Python 3.7 -Python 3.10, Python 3.8, Python 3.9 ___ Python tracker ___ ___ Python-bugs

[issue42169] Apparently all documentation on @typing.overload is wrong

2020-10-27 Thread Ken Jin
Change by Ken Jin : -- nosy: +gvanrossum, kj, levkivskyi versions: -Python 3.6, Python 3.7 ___ Python tracker ___ ___ Python-bugs-l

[issue42169] Apparently all documentation on @typing.overload is wrong

2020-10-27 Thread Peilonrayz
New submission from Peilonrayz : The documentation for `typing.overload` says in a non-stub file the last definition shouldn't be typed. However running that through `mypy --strict` fails. I opened an issue on mypy a couple of days ago, however was told to report this on CPython. ``` >>> imp