Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metacreator #1

Merged
merged 6 commits into from
Jan 31, 2023
Merged

Metacreator #1

merged 6 commits into from
Jan 31, 2023

Conversation

thojou
Copy link

@thojou thojou commented Jan 31, 2023

Fixes Issues with pickeling EphemeralConstats as described in:

DEAP#76
DEAP#280

cmd-ntrf and others added 6 commits May 4, 2015 21:57
The usage of metaclass allow us to stop
registering Ephemeral classes in the gp
module global scope. We also register the
__reduce__ function of MetaEphemeral so
Ephemeral could easily be pickled, as long
as the ephemeral function is picklable
(i.e.: no lambda function). The metaclass
also has a cache based on class id to
avoid creating new object for the same
ephemeral when unpickling.
lambda can't pickled and will never be picklable.
The test was failing because of Python incapicity
to pickle lambdas, not because of MetaEphemeral
logic. Therefore, I am replacing lambda by a partial
and plan to do it for every examples in GP.
@thojou thojou merged commit 82fb177 into thojou-labs:develop Jan 31, 2023
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