Skip to content
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

Make some minor tweaks to mysqldump_to_csv.py #18

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

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