Skip to content

Conversation

@marcharper
Copy link
Member

No description provided.

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.

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)

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:
Copy link
Member

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:

@marcharper
Copy link
Member Author

For type hints there are supposed to be spaces, looking at the examples in its PEP, e.g.:

def func(x: Union[int, None, Empty] = _empty) -> int:

and

def embezzle(self, account: str, funds: int = 1000000, *fake_receipts: str) -> None:

@drvinceknight
Copy link
Member

For type hints there are supposed to be spaces, looking at the examples in its PEP, e.g.:

Cool. I wondered if it might be something like this. 👍

@marcharper
Copy link
Member Author

marcharper commented Jun 4, 2017

@drvinceknight Made some additional style fixes. Can you diagnose the travis issue with the docstring? I don't understand what it wants.

@drvinceknight
Copy link
Member

I'll take a look. Note unit tests are also failing because of your attribute/method rename in dbs.

@marcharper
Copy link
Member Author

Unittests fixed.

@drvinceknight
Copy link
Member

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). :)

@marcharper
Copy link
Member Author

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!

@drvinceknight
Copy link
Member

drvinceknight commented Jun 4, 2017

Fixing the merge conflicts now :) (Just running tests to be sure.)

@drvinceknight
Copy link
Member

Assuming tests pass etc, I am happy with this 👍

@meatballs meatballs merged commit a797167 into master Jun 4, 2017
@meatballs meatballs deleted the pep8 branch June 4, 2017 13:21
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.

4 participants