KEMBAR78
gh-125631: Enable setting persistent_id and persistent_load of pickler and unpickler by serhiy-storchaka · Pull Request #125724 · python/cpython · GitHub
Skip to content

Conversation

@serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Oct 19, 2024

pickle.Pickler and pickle.Unpickler instances have now managed dicts. Arbitrary instance attributes, including persistent_id and persistent_load, can now be set.

@serhiy-storchaka serhiy-storchaka added the needs backport to 3.13 bugs and security fixes label Oct 19, 2024
@serhiy-storchaka serhiy-storchaka changed the title gh-125660: Enable setting persistent_id and persistent_load of pickler and unpickler gh-125631: Enable setting persistent_id and persistent_load of pickler and unpickler Oct 19, 2024
…pickler and unpickler

pickle.Pickler and pickle.Unpickler instances have now managed dicts.
Arbitrary instance attributes, including persistent_id and persistent_load,
can now be set.
ME_size = struct.calcsize('Pn0P')
check = self.check_sizeof
check(p, basesize +
2 * P + # Managed dict
Copy link
Contributor

Choose a reason for hiding this comment

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

I prefer it to be more aligned. like this

check(p, basesize + 
      2 * P + 
      ....

This suggestion applies to all changes.

@serhiy-storchaka serhiy-storchaka deleted the pickler-unpickler-dict branch November 7, 2024 06:54
@picnixz
Copy link
Member

picnixz commented Nov 7, 2024

Closed in favor of #125752.

@picnixz picnixz removed the needs backport to 3.13 bugs and security fixes label Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants