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

Refactor Player.__new__ to automatically apply init_args #817

Merged
merged 1 commit into from
Jan 16, 2017
Merged

Conversation

marcharper
Copy link
Member

@marcharper marcharper commented Jan 15, 2017

I've eliminated the need for @init_args by modifying Player.__new__ and eliminated most usage of init_args in the library. Player.__new__ now caches the args and kwargs passed to __init__. There's no need to explicitly use the decorator except for one case in LookerUp where the classes are created dynamically at runtime, but it may be possible to eliminate that as well.

@meatballs This may solve your issue on #706, and if not, it should be easier to fix now.

@drvinceknight
Copy link
Member

Can you modify the contribution docs to reflect this please: http://axelrod.readthedocs.io/en/latest/tutorials/contributing/strategy/writing_the_new_strategy.html

(There's a paragraph at the end about adding the init_args decorator.)

@marcharper
Copy link
Member Author

I did change the docs :) I'll rebase.

@drvinceknight
Copy link
Member

drvinceknight commented Jan 16, 2017 via email

@meatballs
Copy link
Member

Nice! 👍

@drvinceknight drvinceknight merged commit e2f2961 into master Jan 16, 2017
@marcharper marcharper deleted the init branch January 31, 2017 06:57
@meatballs meatballs mentioned this pull request Mar 29, 2017
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.

None yet

3 participants