You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a seemingly simple example with generics, close to the one presented in the docs, mashumaro seems to stumble on dict[str, T] annotation; wonder if this is intended, or a bug, or some misunderstanding on my side?
Edit: after some trial and error, it seems to work if and only if you quote 'Foo[T]' which isn't immediately obvious from the docs, since it's valid code (e.g. with from __future__ import annotations).
What makes it even worse is that some linters (e.g. ruff) force-strip quotes from type annotations by default (link).
Postponed evaluation of annotations is pain in the ass. Function inspect.signature returns string instead of ForwardRef object in this case and we need to evaluate it. Fortunately, almost everything is ready for this since I've been working on ForwardRef support:
In a seemingly simple example with generics, close to the one presented in the docs, mashumaro seems to stumble on
dict[str, T]
annotation; wonder if this is intended, or a bug, or some misunderstanding on my side?yields
The text was updated successfully, but these errors were encountered: