Skip to content

pystac probably needs an implementation of StrEnum #265

@schwehr

Description

@schwehr

Just like the Enum package has enum.IntEnum, pystac should like have a StrEnum class. It doesn't have to be much, I since there are a bunch of them, it would be a bit cleaner.

class StrEnum(str, Enum):
    pass
find pystac -name \*.py | xargs grep Enum | grep str
pystac/extensions/__init__.py:class Extensions(str, Enum):
pystac/extensions/label.py:class LabelType(str, Enum):
pystac/link.py:class LinkType(str, Enum):
pystac/stac_object.py:class STACObjectType(str, Enum):
pystac/catalog.py:class CatalogType(str, Enum):
pystac/media_type.py:class MediaType(str, Enum):

After trying it a bit, I don't think it needs any extra code.

Hmmmm... StrEnum is in python 3.10, so, maybe not. Idonno.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions