You are here: Home / LBN / Up2date / Core Linux / BastionLinux 36 / python3-backports-strenum-1.3.1-1.lbn36.noarch

python3-backports-strenum-1.3.1-1.lbn36.noarch

Package Attributes
RPM  python3-backports-strenum-1.3.1-1.lbn36.noarch.rpm Architecture  noarch Size  21174 Created  2025/05/19 12:49:45 UTC
Package Specification
Summary Base class for creating enumerated constants that are also subclasses of str
Group Unspecified
License ZPL
Home Page https://pypi.org/project/backports-strenum
Description

A backport of (copy and paste from) python 3.11’s StrEnum class for >=3.8.6: See the design discussion, and Ethan Furman’s first and second PR with this implementation. A slightly different implementation would likely be compatible with lower python versions; PRs are welcome if they pass the test suite. The existing (reference) implementation should still be the one used on supported versions.

Use with: import sys

if sys.version_info >= (3, 11): from enum import StrEnum else: from backports.strenum import StrEnum

class MyStrEnum(StrEnum): POTATO = "potato" ORANGE = "orange" SPADE = "spade"

MyStrEnum.POTATO == "potato" # True MyStrEnum.ORANGE.upper() == "ORANGE" # True str(MyStrEnum.SPADE) == "spade" # True

Requires
python  
rpmlib(PayloadIsZstd)  
rpmlib(PartialHardlinkSets)  
rpmlib(CompressedFileNames)  
rpmlib(PayloadFilesHavePrefix)  
rpmlib(FileDigests)  
Provides
python-backports-strenum
python3-backports-strenum
python3.10-backports-strenum
python3.10dist(backports-strenum)
python3.10dist(backports.strenum)
python3dist(backports-strenum)
python3dist(backports.strenum)
Obsoletes
python-backports-strenum

Document Actions