types-enum34 is a PEP 561 type stub package providing static type information for the `enum34` library. The `enum34` library itself is a backport of Python 3.4's standard library `enum` module, enabling enumeration support for older Python versions (2.4-3.3). This stub package allows type-checking tools like MyPy, PyCharm, and Pytype to analyze code that uses `enum34`. The current version is 1.1.8, released in January 2022, and its development cadence follows contributions to the `typeshed` project.
pip install types-enum34Verified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to define and use an enumeration, consistent with the `enum34` library's API (which `types-enum34` provides stubs for). The `types-enum34` package itself does not introduce new runtime functionality; it merely provides static type hints. This code is designed to work with the `enum34` runtime package. For Python versions 3.4 and above, the `enum` module is part of the standard library, rendering `enum34` (and thus `types-enum34`) largely obsolete for new projects.
Do not install `enum34` on Python 3.4 or later. If it's already installed, uninstall it: `pip uninstall enum34`. Python 3.4+ includes `enum` in its standard library, making `enum34` redundant.
Ensure `enum34` is installed alongside `types-enum34` if you are targeting Python versions where `enum` is not part of the standard library (i.e., Python < 3.4).
For Python 3.4+, rely on the built-in `enum` module. If type checking is needed, mypy and other tools will automatically find stubs for the standard library module.
Ensure you are using recent versions of your type checker and `types-enum34`. If issues persist, refer to the `typeshed` GitHub repository for the latest status and workarounds.