question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Python 3.9 extract_generic fails

See original GitHub issue

I 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:closed
  • Created 3 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
konradhalascommented, Nov 27, 2020

Thank you @acepace for reporting this issue. It should be fixed in master.

@zcutlip thank you for the simple and clean solution.

1reaction
zcutlipcommented, Nov 29, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found