class Pet(Enum):
CAT = 1 # Member attribute
DOG = 2 # Member attribute
WOLF: int = 3 # New error: Enum members must be left unannotated
species: str # Considered a non-member attribute
In particular, the specification change can result in issues in type stubs (.pyi files), since
historically it was common to leave the value absent:
# In a type stub (.pyi file)
class Pet(Enum):
# Change in semantics: previously considered members, now non-member attributes
CAT: int
DOG: int
# Mypy will now issue a warning if it detects this situation in type stubs:
# > Detected enum "Pet" in a type stub with zero members.
# > There is a chance this is due to a recent change in the semantics of enum membership.
# > If so, use `member = value` to mark an enum member, instead of `member: type`
class Pet(Enum):
# As per the specification, you should now do one of the following:
DOG = 1 # Member attribute with value 1 and known type
WOLF = cast(int, ...) # Member attribute with unknown value but known type
LION = ... # Member attribute with unknown value and unknown type
Contributed by Terence Honles in PR 17207 and
Shantanu Jain in PR 18068.
Mypy 1.13
We’ve just uploaded mypy 1.13 to the Python Package Index (PyPI).
Mypy is a static type checker for Python. You can install it as follows:
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself)
- `@dependabot ignore minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself)
- `@dependabot ignore ` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore ` will remove all of the ignore conditions of the specified dependency
- `@dependabot unignore ` will remove the ignore condition of the specified dependency and ignore conditions
Bumps the dev-dependencies group with 3 updates: mypy, tox and ruff.
Updates
mypy
from 1.11.2 to 1.13.0Changelog
Sourced from mypy's changelog.
... (truncated)
Commits
eb31034
Bump version to 1.13.02eeb588
Update changelog for 1.12.1 (#17999)bc0386b
Changelog for 1.13 (#18000)5c4d2db
Add faster-cache extra, test in CI (#17978)854ad18
Make is_sub_path faster (#17962)50aa4ca
Speed up stubs suggestions (#17965)7c27808
Use orjson instead of json, when available (#17955)2cd2406
Use fast path in modulefinder more often (#17950)e20aaee
Let mypyc optimise os.path.join (#17949)159974c
Use sha1 for hashing (#17953)Updates
tox
from 4.21.2 to 4.23.2Release notes
Sourced from tox's releases.
Changelog
Sourced from tox's changelog.
Commits
0447036
release 4.23.2f0799ac
Support external tox.pytest usage via "test" extra (#3422)ec88713
Fix docs link check962bc59
release 4.23.15916cc9
Fix example docs (#3421)e9cb93a
[pre-commit.ci] pre-commit autoupdate (#3418)88c1b99
Docs: adjusting EOL Python version testing remarks (#3417)7696a8e
release 4.23.0c01a023
Add NETRC to the default_pass_env list (#3410)971e7da
replace tool.pyproject and tool.tox.pyproject with tool.tox in config… (#3411)Updates
ruff
from 0.6.8 to 0.7.2Release notes
Sourced from ruff's releases.
... (truncated)
Changelog
Sourced from ruff's changelog.
... (truncated)
Commits
11c3b52
generate using cargo-dista388e49
Temporary comment out certain release steps099f077
[docs] Add rule short code to mkdocs tags (#14040)8574751
Give non-existent files a durability of at least Medium (#14034)ddae741
Switch touv publish
(#14042)5053d2c
Doc: markdown link fix (#14041)ef72fd7
Bump version to 0.7.2 (#14039)658a51e
Fix typo for static method decorator (#14038)7c2da4f
Sync vendored typeshed stubs (#14030)48fa839
Use named function in incremental red knot benchmark (#14033)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show