-
Notifications
You must be signed in to change notification settings - Fork 271
Add type hints to apavlov #846
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 apavlov #846
Conversation
It does look like a mypy issue. I'm not sure how to deal with it. Any suggestion @marcharper?
Don't worry about this, it's just a warning and not a failure. Travis triggered a failure but that was for a timeout on some of our property based tests, I've reset that so we'll see if that fixes itself. |
@janga1997 please add the strategy file to type_tests.sh In Python 3.5 we cannot annotate variables, that's a Python 3.6 feature. If you are using Python 3.6 for testing with mypy you may get different results. Travis will check both once you add the file to type_tests. |
@marcharper I am using Python 3.5. |
I'm not sure really -- can you rebase/merge and run mypy again? I'll take a closer look at the errors. |
mypy is unhappy because we're using both None and strings for the same variable without declaring its type. Just change both lines to: |
… into typeHint-apavlov
Since #852 has been merged in there are now merge conflicts @janga1997 :) |
#808 @drvinceknight @marcharper
mypy produces two errors.
axelrod/strategies/apavlov.py:31: error: Need type annotation for variable axelrod/strategies/apavlov.py:98: error: Need type annotation for variable
It seems like an issue with mypy itself. I'm not sure.
And the local test produces errors which I don't think has anything to do with type hinting.
/home/janga/Axelrod/axelrod/mock_player.py:61: UserWarning: Simulated play mismatch with expected history: Round was (C, C) but (C, D) was expected for player: Adaptive Pavlov 2006 s1, s2, action1, action2, str(player1))
and more of the same error.