I am building a general-purpose NLP pipeline that will be able to use one of the several state-of-the-art NLP libraries currently out there. The library and exact model to use will be specified when instantiating the general purpose pipe. For this, I have created an enum whose values will be passed over to the general pipe's init and looks like this for now (only the spaCy part is ready):
@unique
class LibrKey(Enum):
"""NLP-library to use."""
CUSTOM = auto()
SPACY_SM = "en_core_web_sm"
SPACY_MD = "en_core_web_md"
SPACY_LG = "en_core_web_lg"
SPACY_TR = "en_core_web_trf"
STANZA = auto()
TRANKIT = auto()
I was wondering, however, about the correctness of having both auto instances and strings as values for the enum. According to the latest enum docu, namely, https://docs.python.org/3/library/enum.html care should be taken in these cases:
Member values can be anything: int, str, etc.. If the exact value is unimportant you may use auto instances and an appropriate value will be chosen for you. Care must be taken if you mix auto with other values.
So I was also wondering what is exactly meant with having to take care here.