Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Honor return type of `__new__` #7188
This basically follows the approach Jukka laid out in #1020 four years ago:
The main motivation for me in implementing this is to support
This basically follows the approach Jukka laid out in #1020 four years ago: * If the return type is Any, ignore that and keep the class type as the return type * Otherwise respect `__new__`'s return type * Produce an error if the return type is not a subtype of the class. The main motivation for me in implementing this is to support overloading `__new__` in order to select type variable arguments, which will be useful for subprocess.Popen. Fixes #1020.
ilevkivskyi left a comment
Thanks! Generally looks good, but there is one suspicious place.
How hard would be to support a similar feature for