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
...
import pickle
...
class MyPickler(pickle.Pickler):
def reducer_override(self, obj):
"""Custom reducer for MyClass."""
...
However, my code that does that now fails with pyright 1.1.393:
error: Method "reducer_override" overrides class "Pickler" in an incompatible manner
Positional parameter count mismatch; base method has 1, but override has 2 (reportIncompatibleMethodOverride)
I think it's because of this definition in typeshed:
CPython docs explain about
Pickler.reduce_override
:https://docs.python.org/3/library/pickle.html#custom-reduction-for-types-functions-and-other-objects
And a code example is provided:
However, my code that does that now fails with pyright 1.1.393:
I think it's because of this definition in typeshed:
typeshed/stdlib/_pickle.pyi
Line 63 in c193cd2
The text was updated successfully, but these errors were encountered: