Can you maybe extend the CSI comment about why Literal needs to be treated here as well?
To me, it looks rather natural in this sequence and it might look a bit strange if I explain only the Literal bit:
(
"<class 'typing._GenericAlias'>",
"<class 'types.GenericAlias'>",
"<class 'typing._LiteralGenericAlias'>",
)They're all Generic aliases.
OTOH, it's hard to imagine that we'll ever put a telegram class inside a literal. Something like:
Persistence = Literal["PicklePersistence", "DictPersistence"]
In this case, I could just create a separate condition for Literal and skip it altogether without even checking what's inside.