Skip to content

Conversation

@ngie-eign
Copy link

  • Use .startswith(..) in place of the unrolled versions of the
    equivalent functionality.
  • Use if foo: and if not foo: instead of if len(foo) != 0:
    and if len(foo) == 0:. The former set of patterns is more
    performant and it protects against foo potentially not being
    an iterable object, or an object that doesn't implement
    .__len__(..).
  • Change the mode of the script to 0755 so it's executable out of
    the box.

Signed-of-by: Enji Cooper [email protected]

* Use `.startswith(..)` in place of the unrolled versions of the
  equivalent functionality.
* Use `if foo:` and `if not foo:` instead of `if len(foo) != 0:`
  and `if len(foo) == 0:`. The former set of patterns is more
  performant and it protects against `foo` potentially not being
  an iterable object, or an object that doesn't implement
  `.__len__(..)`.
* Change the mode of the script to 0755 so it's executable out of
  the box.

Signed-of-by:	Enji Cooper <[email protected]>
This makes things more consistent, using an upstream stylization
tool.

Ref:	https://github.com/psf/black
@ngie-eign
Copy link
Author

@jamesmishra: ping?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant