Closed
Description
- cattrs version: current master
- Python version: 3.10
- Operating System: Linux
The error
File ".venv/lib/python3.10/site-packages/cattrs/dispatch.py", line 122, in dispatch
return handler(typ)
File ".venv/lib/python3.10/site-packages/cattrs/converters.py", line 829, in gen_structure_mapping
h = make_mapping_structure_fn(
File ".venv/lib/python3.10/site-packages/cattrs/gen.py", line 726, in make_mapping_structure_fn
eval(compile(script, "", "exec"), globs)
File "<string>", line 17
raise IterableValidationError('While structuring dict[typing.Union[typing.Literal['ca', 'pro', 'fa', 'car', 'ing_emb'], typing.Literal['wgr', 'cwg', 'fcc', 'wcc']], statistics.FrequenciesInfo]', errors, __cattr_mapping_cl)
| SyntaxError: invalid syntax. Perhaps you forgot a comma?
The offending code is here gen :
It seems to generate code that assumes that the repr of the offending type does not include '. '
is not escaped.
Metadata
Metadata
Assignees
Labels
No labels