-
Notifications
You must be signed in to change notification settings - Fork 264
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
Conversation
@@ -3,7 +3,7 @@ | |||
from axelrod import Actions | |||
|
|||
|
|||
def random_choice(p=0.5): | |||
def random_choice(p=0.5: float): |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
The PR needs a second review. |
There was a problem hiding this 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.
Fixes a part of #808