Codecademy Intermediate Python 3 OOP lesson on super()
in dataclass syntax with Enum
Enum requires at least Python 3.4 to run the file. Here is the link to documentation: enum โ Support for enumerations
Dataclasses were first introduced in Python 3.7. They can be backported to Python 3.6 by running pip install dataclasses
.
Here is list of links with more info:
- Official documentation: dataclasses โ Data Classes
- Backport: dataclasses 0.8
- Real Python article: Data Classes in Python 3.7+ (Guide)
The use of the slots=True
and kw_only=True
keyword arguments in the @dataclass
decorator requires Python 3.10.
The use of the StrEnum
in the enum class requires Python 3.11.