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
I'm inheriting from logging.StreamHandler and getting this error on Pyright
classMyStreamHandler(StreamHandler):
Expected type arguments for generic class "StreamHandler"
If I try to add an argument then I get code that doesn't work:
classMyStreamHandler(StreamHandler[TextIO]):
class MyStreamHandler(StreamHandler[TextIO]):
TypeError: 'type' object is not subscriptable
I believe this is due to this class being generic on typeshed, but not in stdlib. Now I'm not really sure how to inherit from it and make the typechecker happy
The text was updated successfully, but these errors were encountered:
Hello,
I'm inheriting from logging.StreamHandler and getting this error on Pyright
Expected type arguments for generic class "StreamHandler"
If I try to add an argument then I get code that doesn't work:
I believe this is due to this class being generic on typeshed, but not in stdlib. Now I'm not really sure how to inherit from it and make the typechecker happy
The text was updated successfully, but these errors were encountered: