[Python-ideas] Type hints for functions with side-effects and for functions raising exceptions
Ivan Levkivskyi
levkivskyi at gmail.com
Thu Feb 21 17:28:43 EST 2019
On Tue, 19 Feb 2019 at 21:07, Miikka Salminen <miikka.salminen at gmail.com>
wrote:
> Hi!
>
> To help automatic document generators and static type checkers reason more
> about the code, the possible side-effects and raised exceptions could also
> be annotated in a standardized way.
>
The idea about "checked exceptions" appeared several times in various
places. I used to think that this would be hard to support for any
realistic use cases. But now I think there may be a chance
to turn this into a usable feature if one frames it correctly (e.g. the
focus could be on user defined exceptions, rather than on standard ones,
since there is no way we can annotate every function in typeshed).
But this is probably not the best place to the start the discussion (we may
come back here if we will have a proposal). I would recommend to post
either on typing GitHub tracker, or mypy GitHub tracker,
or on typing SIG mailing list.
IMO the part about side effects is a non-starter.
--
Ivan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20190221/2f0914f8/attachment-0001.html>
More information about the Python-ideas
mailing list