Skip to content

Commit

Permalink
update allowlist comment for SupportsAbs and SupportsRound (#13380)
Browse files Browse the repository at this point in the history
The answer to the question is that mypy infers it just fine, but
stubtest doesn't check for attributes inherited from the metaclass
because that's almost never what we want. In this case,
the runtime implementation doesn't get __type_params__ from
builtins.type either. It's actually defined for the class due to
the use of PEP-695 syntax.
  • Loading branch information
tungol authored Jan 9, 2025
1 parent 614e949 commit e55c13a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions stdlib/@tests/stubtest_allowlists/py312.txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,7 @@ typing.ParamSpecKwargs.__mro_entries__
typing.TypeVar.__mro_entries__
typing.TypeVarTuple.__mro_entries__

# TODO: mypy should infer that this attribute is inherited from builtins.type;
# why doesn't it infer this?
# These exist at runtime because the protocol uses PEP-695 syntax in CPython
typing.SupportsAbs.__type_params__
typing.SupportsRound.__type_params__
typing_extensions.SupportsAbs.__type_params__
Expand Down
3 changes: 1 addition & 2 deletions stdlib/@tests/stubtest_allowlists/py313.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,7 @@ typing.ParamSpecKwargs.__mro_entries__
typing.TypeVar.__mro_entries__
typing.TypeVarTuple.__mro_entries__

# TODO: mypy should infer that this attribute is inherited from builtins.type;
# why doesn't it infer this?
# These exist at runtime because the protocol uses PEP-695 syntax in CPython
typing.SupportsAbs.__type_params__
typing.SupportsRound.__type_params__
typing_extensions.SupportsAbs.__type_params__
Expand Down

0 comments on commit e55c13a

Please sign in to comment.