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
Would it make sense for arbitrary dictionaries, such as Document meta, to be type hinted as typing.Mapping? My reason is that I would like to utilize TypedDict for additional type hinting, but passing TypedDict instantiation to dict decorated functions upsets the type checker, and I have to do something like meta=dict(MyTypedDict(x=1)).
I wonder if it makes sense to "loosen" the type requirement by using Mapping instead?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Thanks for this excellent project!
Would it make sense for arbitrary dictionaries, such as Document meta, to be type hinted as
typing.Mapping
? My reason is that I would like to utilizeTypedDict
for additional type hinting, but passingTypedDict
instantiation todict
decorated functions upsets the type checker, and I have to do something likemeta=dict(MyTypedDict(x=1))
.I wonder if it makes sense to "loosen" the type requirement by using
Mapping
instead?Beta Was this translation helpful? Give feedback.
All reactions