Replies: 1 comment 2 replies
-
Moving this to a discussion since it's a request for assistance and not a bug report. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey,
I'm kinda lost with trying to use a
UserDict
, from different angles. I've been fighting with this for two days now, to no avail. Typing is meta and hard, and I'm starting to think I don't have the mental fortitude for this complexity, to put it mildly. It might well be I'm missing something.The original code was written for django, I've boiled it down to a minimal reproducible example. See the typing error in line 51:
Code sample in pyright playground
I've tried to play around with covariance/contravariance, in both cases the
CacheBase
definition started to fail on type checking. Also I couldn't find anything on this, but isn't it so that a boundTypeVar
(e.g._SeqT
) is automatically covariant?Beta Was this translation helpful? Give feedback.
All reactions