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

Add type hints to random #821

Merged
merged 2 commits into from
Jan 18, 2017
Merged

Add type hints to random #821

merged 2 commits into from
Jan 18, 2017

Conversation

souravsingh
Copy link
Contributor

Fixes a part of #808

@@ -3,7 +3,7 @@
from axelrod import Actions


def random_choice(p=0.5):
def random_choice(p=0.5: float):
Copy link
Member

Choose a reason for hiding this comment

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

Hello @souravsingh I am a member of the Axelrod team 😄!
I believe you should drop :float cause p is determined. That should be the syntax error

Copy link
Member

Choose a reason for hiding this comment

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

I think the syntax parser wants something like (p: float = 0.5)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Nikoleta-v3 Nice to meet you!
I will look into the review.

@marcharper What should be the return type set? Should it be imported as Action.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah importing the type from actions.py is the way to go.

@souravsingh
Copy link
Contributor Author

souravsingh commented Jan 17, 2017

The PR needs a second review.

Copy link
Member

@drvinceknight drvinceknight left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for pitching in with the review @Nikoleta-v3.

@marcharper marcharper merged commit 155332f into Axelrod-Python:master Jan 18, 2017
@souravsingh souravsingh deleted the add-type branch January 23, 2017 09:25
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

4 participants