8000 Added draft chapter to typing spec for constructors. by erictraut · Pull Request #1667 · python/typing · GitHub
[go: up one dir, main page]

Skip to content

Added draft chapter to typing spec for constructors. #1667

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Apr 11, 2024
Merged
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Incorporated PR feedback.
  • Loading branch information
erictraut committed Mar 28, 2024
commit c5dfb1fcc5bf5ef0d142d7ce50a4e7fb41b3041b
16 changes: 8 additions & 8 deletions docs/spec/constructors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ calls are not supported for that class.
==================

After the metaclass ``__call__`` method has been evaluated, a type checker
should evaluate the ``__new__`` method of the class using the supplied arguments.
If the class is generic and explicitly specialized, the type checker
should partially specialize the ``__new__`` method using the supplied type
arguments. If the class is not explicitly specialized, class-scoped type
variables should be solved using the supplied arguments passed to the constructor
call.
should evaluate the ``__new__`` method of the class (if applicable) using
the supplied arguments. If the class is generic and explicitly specialized,
the type checker should partially specialize the ``__new__`` method using the
supplied type arguments. If the class is not explicitly specialized,
class-scoped type variables should be solved using the supplied arguments
passed to the constructor call.

::

Expand Down Expand Up @@ -157,8 +157,8 @@ that arise during binding.
===================

After evaluating the ``__new__`` method, a type checker should evaluate the
``__init__`` method using the supplied arguments. If the class is
generic and explicitly specialized (or specialized via the ``__new__`` method
``__init__`` method (if applicable) using the supplied arguments. If the class
is generic and explicitly specialized (or specialized via the ``__new__`` method
return type), the type checker should partially specialize the ``__init__``
method using the supplied type arguments. If the class is not explicitly
specialized, class-scoped type variables should be solved using the supplied
Expand Down
0