Brett Cannon <br...@python.org> added the comment:
First off, thanks for the suggestion! But there are two things to say about this. One, that isn't actually casting as Python doesn't have the concept of casting like in statically typed languages since everything is dynamically typed. Two, the solution is so short and simple but not widely needed enough that I don't think this warrants addition in the stdlib. And since you're changing what the function returns you probably need a new docstring anyway, which means having to do a normal wrapping of the function. So thanks for the idea but I don't think we will be adding this to the stdlib (obviously feel free to put this up on PyPI or as a gist somewhere and share it in a blog post or something. ---------- nosy: +brett.cannon resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue38940> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com