Skip to content

Comments

Fix _Pickle.reducer_override annotation#13545

Open
srittau wants to merge 6 commits intopython:mainfrom
srittau:pickle-reducer-override
Open

Fix _Pickle.reducer_override annotation#13545
srittau wants to merge 6 commits intopython:mainfrom
srittau:pickle-reducer-override

Conversation

@srittau
Copy link
Collaborator

@srittau srittau commented Feb 26, 2025

Closes: #13446

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Comment on lines +218 to +221
# The following method is not defined on _Pickler, but can be defined on
# sub-classes. Should return `NotImplemented` if pickling the supplied
# object is not supported and returns the same types as `__reduce__()`.
def reducer_override(self, obj: object, /) -> _ReducedType: ...
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be done for _pickler.Pickler (aka the public pickle.Pickler) as well?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, done.

@github-actions

This comment has been minimized.

@srittau
Copy link
Collaborator Author

srittau commented Oct 8, 2025

Stubtest errors are unrelated.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 8, 2025

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pickle.Pickler.reducer_override: Positional parameter count mismatch; base method has 1, but override has 2

2 participants