Skip to content

Conversation

@claudevdm
Copy link

@claudevdm claudevdm commented Nov 11, 2025

This adds a new CloudPickleConfig argument that is meant to override the default behaviors for users with specific needs like deterministic hash (at the cost of performance regression).

The default config maintains behavior prior to this PR.

The first CloudPickleConfig option is to pass an id_generator that is used to create ID's for dynamic classes and typevars (to maintain isinstance semantics).

If the id_generator is omitted then new types will always be defined and isinstance semantics is lost.

Also included is a hash_dynamic_classdef function that can be passed via CloudPickleConfig.id_generator that pickles the classdef as mentioned in #568 (comment)

The unit test setup is refactored a bit to allow passing configs between processes.

This PR is related to #510 and #453

@claudevdm
Copy link
Author

FYI @tvalentyn

@claudevdm
Copy link
Author

claudevdm commented Nov 11, 2025

@tomMoral @ogrisel
can you please take a look at this proposal?

@ogrisel
Copy link
Contributor

ogrisel commented Nov 13, 2025

I am a bit busy these days. Maybe @tomMoral has the time for a first pass and I could then do a second pass later?

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.

2 participants