- cattrs version: 22.1.0
- Python version: 3.8
- Operating System: macOS
Description
GenConverter's unstruct_collection_overrides param expects a collections.abc.Set in Python 3.9+ and a typing.Set in Python 3.8 and below. typing.Set is a generic version of the set built-in; the typing module's equivalent of collections.abc.Set is AbstractSet. In 3.8 and below, collections.abc.Set is silently ignored and typing.Set incorrectly applies to all set types. I would expect collections.abc.Set to work on all (supported) Python versions, especially considering that paremetrised overrides are not supported (Set[...] has no effect).
What I Did
from collections.abc import Set
converter = GenConverter(unstruct_collection_overrides={Set: sorted})
converter.unstructure(frozenset(())) # Not converted to a list on Python 3.8