Skip to content

Bump mypy from 1.13.0 to 1.14.0

HIFIS Bot requested to merge dependabot-pip-mypy-1.14.0 into master

Bumps mypy from 1.13.0 to 1.14.0.

Changelog

Sourced from mypy's changelog.

Mypy Release Notes

Next release

...

Mypy 1.14

We’ve just uploaded mypy 1.14 to the Python Package Index (PyPI). Mypy is a static type checker for Python. This release includes new features and bug fixes. You can install it as follows:

python3 -m pip install -U mypy

You can read the full documentation for this release on Read the Docs.

Change to Enum Membership Semantics

As per the updated typing specification for enums, enum members must be left unannotated.

class Pet(Enum):
    CAT = 1  # Member attribute
    DOG = 2  # Member attribute
# New error: Enum members must be left unannotated
WOLF: int = 3
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,

</tr></table>

... (truncated)

Commits

Merge request reports

Loading