-
Notifications
You must be signed in to change notification settings - Fork 282
Various PEP8 and style fixes #1037
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
Conversation
drvinceknight
left a comment
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.
This all looks great to me, just the one point about space around default variable assignment. It comes under the "Other recommendations" in PEP8:
Don't use spaces around the = sign when used to indicate a keyword argument or a default parameter value.
Yes:
def complex(real, imag=0.0):
return magic(r=real, i=imag)No:
def complex(real, imag = 0.0):
return magic(r = real, i = imag)
axelrod/mock_player.py
Outdated
| def __init__(self, actions: List[Action] =None, history: List[Action] =None, state_dist: defaultdict =None) -> None: | ||
| def __init__(self, actions: List[Action] = None, | ||
| history: List[Action] = None, | ||
| state_dist: defaultdict = None) -> None: |
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.
My linter is picking defaultdict = None (etc) up:
[bad-whitespace] No space allowed around keyword argument assignment [python/pylint]
It's happy with:
state_dist: defaultdict=None) -> None:|
For type hints there are supposed to be spaces, looking at the examples in its PEP, e.g.: and |
Cool. I wondered if it might be something like this. 👍 |
b85fa67 to
eca98a3
Compare
|
@drvinceknight Made some additional style fixes. Can you diagnose the travis issue with the docstring? I don't understand what it wants. |
|
I'll take a look. Note unit tests are also failing because of your attribute/method rename in dbs. |
|
Unittests fixed. |
|
Cool, I'm heading out for a walk but assume it's ok if I push a fix directly for the docstring later (I expect it's just sphinx being very picky about some indentation). :) |
Please do! |
|
Fixing the merge conflicts now :) (Just running tests to be sure.) |
I'm not totally satisfied with the fix but this is caused by the formatting of the auto documentation.
|
Assuming tests pass etc, I am happy with this 👍 |
No description provided.