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 features-and-bugs group with 5 updates in the / directory:
1.12.1
1.13.0
0.7.0
0.7.2
3.3.2
3.3.3
3.0.1
3.0.2
20.27.0
20.27.1
Updates
mypy
from 1.12.1 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
ruff
from 0.7.0 to 0.7.2Release notes
Sourced from ruff's releases.
... (truncated)
Changelog
Sourced from ruff's changelog.
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)Updates
sphinx-autoapi
from 3.3.2 to 3.3.3Release notes
Sourced from sphinx-autoapi's releases.
Changelog
Sourced from sphinx-autoapi's changelog.
Commits
f5c7295
Version 3.3.3eb2d7f2
Fix crash when init is assigned to0e9bb9b
Document package and modules under a "submodules" heading53c2abc
Attach release note to correct issue489abb1
Add missing release note9dd7851
Fix adding incorrect attributes from initbedadd4
Add newline before a property's doc stringfac7695
Remove old workaround for towncrier2b31d39
Switch to flitfb73609
PEP 621: Migrate from setup.cfg to pyproject.tomlUpdates
markupsafe
from 3.0.1 to 3.0.2Release notes
Sourced from markupsafe's releases.
Changelog
Sourced from markupsafe's changelog.
Commits
28ace20
release version 3.0.26b51fd8
build requires at least setuptools 70.1 (#478)99dda9f
build requires at least setuptools 70.13d8fd8c
fix version1933c4b
fix versione85aff4
relax speedups str check (#477)8cb1691
relax speedups str check4dafb7c
start version 3.1.09c44ecf
update docs build275c769
Merge branch '2.1.x' into 3.0.xUpdates
virtualenv
from 20.27.0 to 20.27.1Release notes
Sourced from virtualenv's releases.
Changelog
Sourced from virtualenv's changelog.
Commits
cb20fda
release 20.27.18425467
Upgrade to pip 24.3 (#2790)17ee28f
Merge pull request #2787 from pypa/pre-commit-ci-update-configfd2b921
[pre-commit.ci] pre-commit autoupdate72f4019
Merge pull request #2785 from pypa/release-20.27.0Dependabot 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