This repository has been archived by the owner on Feb 22, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 147
Improve various code styles #309
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
58b9a2c
No need for lists; prefer tuples as they imply we can't/won't change …
lamby ece38c0
Tidy """-style docstrings, moving everything to a vaguely-consistent …
lamby 499a14c
Tidy code style around imports.
lamby fe5acc8
Reflow indentation to prevent unnecessary VCS diff noise on future ch…
lamby 5302cfe
Import os.path.{join,dirname,abspath} directly instead of importing `…
lamby bfbd05a
Import "batteries-included" modules as top-level, ie. without using `…
lamby e0e9fe4
Drop unnecessary parenthesis.
lamby c9a1f2e
Use [] and {} to generate empty lists and dictionaries over list() an…
lamby 833c810
Use `os.path.join` over constructing paths ourselves.
lamby b799d19
Drop print() statement.
lamby f27e617
Avoid aliasing __builtins__.
lamby e297f78
Define `config` dicts in one go, instead of poking things into them a…
lamby ceb9269
Make it clearer that `sizelim` is a float; "6." is not very obvious!
lamby 5b8f54b
Prefer single quotes over double quotes; the former expresses better …
lamby 972d25f
Drop unnecessary parenthesis.
lamby 8fa8a63
Use the `exist_ok` keyword argument when calling `os.makedirs` instea…
lamby 119a6b6
Use more Pythonic `num_X` variable names over `num_of_X` or `X_count`.
lamby a8bf16f
Improve code spacing variously for readability.
lamby ed2c8a7
Use str.format over interpolation with '%'.
lamby de85306
Drop weird/misleading/commented-out code.
lamby 2558c7c
Tidy "inline" comments.
lamby 4b05193
Cleanup/remove some unnecessary control-flow statement around uncondi…
lamby 0477a6a
Prevent a long line warning.
lamby File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Why do you prefer to import the whole module here while you changed in 5302cfe to directly import methods from a module?
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.
So in general I prefer to import the modules that Python ships with ("batteries included") as top-level modules. However, I am not 100% dogmatic on this (!) and make some exceptions if that's going to make the code unspeakably ugly. For example,, imagine trying to parse:
Make sense? :)
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.
Yes, thank you :)