8000 Bump `enum` to 3.14 by donBarbos · Pull Request #14021 · python/typeshed · GitHub
[go: up one dir, main page]

Skip to content
8000

Bump enum to 3.14 #14021

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 5 commits into from
May 24, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix inspect.pyi errors
  • Loading branch information
donBarbos committed May 12, 2025
commit 32c67ed6a2a12688132e65fa2ec3af625040ef54
2 changes: 1 addition & 1 deletion stdlib/enum.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import types
from _typeshed import SupportsKeysAndGetItem, Unused
from builtins import property as _builtins_property
from collections.abc import Callable, Iterable, Iterator, Mapping
from inspect import Signature
from typing import Any, Generic, Literal, TypeVar, overload
from typing_extensions import Self, TypeAlias

Expand Down Expand Up @@ -167,7 +168,6 @@ class EnumMeta(type):
@overload
def __call__(cls: type[_EnumMemberT], value: Any, *values: Any) -> _EnumMemberT: ...
if sys.version_info >= (3, 14):
from inspect import Signature
@property
def __signature__(cls) -> Signature: ...

8000 Expand Down
10 changes: 5 additions & 5 deletions stdlib/inspect.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -418,11 +418,11 @@ class Parameter:
def __init__(self, name: str, kind: _ParameterKind, *, default: Any = ..., annotation: Any = ...) -> None: ...
empty = _empty

POSITIONAL_ONLY: ClassVar[Literal[_ParameterKind.POSITIONAL_ONLY]]
POSITIONAL_OR_KEYWORD: ClassVar[Literal[_ParameterKind.POSITIONAL_OR_KEYWORD]]
VAR_POSITIONAL: ClassVar[Literal[_ParameterKind.VAR_POSITIONAL]]
KEYWORD_ONLY: ClassVar[Literal[_ParameterKind.KEYWORD_ONLY]]
VAR_KEYWORD: ClassVar[Literal[_ParameterKind.VAR_KEYWORD]]
POSITIONAL_ONLY: ClassVar[Literal[0]]
POSITIONAL_OR_KEYWORD: ClassVar[Literal[1]]
VAR_POSITIONAL: ClassVar[Literal[2]]
KEYWORD_ONLY: ClassVar[Literal[3]]
VAR_KEYWORD: ClassVar[Literal[4]]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not true, at least not for Python 3.12:

Python 3.12.3 (main, Feb  4 2025, 14:48:35) [GCC 13.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import inspect
>>> inspect.Parameter.POSITIONAL_ONLY
<_ParameterKind.POSITIONAL_ONLY: 0>
>>> type(inspect.Parameter.POSITIONAL_ONLY)
<enum '_ParameterKind'>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks you, this was an attempt to solve this error. apparently I was too hasty in getting the PR ready for review

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect it's because you made enum import inspect and that disturbed some import cycle. As you can see from the mypy-primer report, this change is going to cause a lot of issues.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're right because these errors appeared when i added import

@property
def name(self) -> str: ...
@property
Expand Down
0