You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added draft chapter to typing spec for constructors. (#1667)
* Added draft chapter to typing spec for constructors.
* Update docs/spec/constructors.rst
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* Update docs/spec/constructors.rst
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* Update docs/spec/constructors.rst
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* Added section on signature consistency between `__new__` and `__init__`.
* Incorporated PR feedback.
* Added clarification based on question in forum.
* Incorporated feedback about callable conversion. Clarified behaviors when a class doesn't inherit a `__new__` or `__init__` from a class other than `object`.
* Tweaked the spec based on Jelle's feedback about a `__new__` method that returns `Any`. Also clarified what happens when a call to `__call__` or `__new__` evaluates to a union type.
* Updated handling of `Any` return types for `__call__` and `__new__` methods to reflect suggestion from @rchen152 in [this post](https://discuss.python.org/t/draft-typing-spec-chapter-for-constructors/49744/22).
* Incorporated feedback from @gvanrossum.
---------
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
0 commit comments