Python 3.9 extract_generic fails
See original GitHub issueI seem to have failures when using latest dacite with an object of type Dict.
key_cls, item_cls = extract_generic(target_type)
if target_type is List or Dict I get a zero length tuple rather than the expected two values.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Is it possible to return a list with generic type in a function
The built-in list wasn't made a generic type until Python 3.9. In earlier versions, you'll have to use List (from the typing module)...
Read more >type not generic when running with Python < 3.9 · Issue #10303
It's weird that generic dict works, but generic type doesn't. (Although I'd expect both to work with any Python version.).
Read more >Changelog — Python 3.11.1 documentation
gh-94607: Fix subclassing complex generics with type variables in typing . Previously an error message saying Some type variables ... are not ...
Read more >Changelog — Python 3.9.14 documentation
open raises ReadError when a zlib error occurs during file extraction. bpo-44594: Fix an edge case of ExitStack and AsyncExitStack exception chaining. They...
Read more >What's New In Python 3.10 — Python 3.11.1 documentation
This article explains the new features in Python 3.10, compared to 3.9. ... Pattern matching enables programs to extract information from complex data...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you @acepace for reporting this issue. It should be fixed in
master
.@zcutlip thank you for the simple and clean solution.
Thanks for the quick patch. I’m glad I procrastinated and didn’t send you a PR because you caught some changes I would have missed.