Skip to content

Style stuff#2

Open
adeak wants to merge 5 commits into
SOBotics:masterfrom
adeak:style_stuff
Open

Style stuff#2
adeak wants to merge 5 commits into
SOBotics:masterfrom
adeak:style_stuff

Conversation

@adeak

@adeak adeak commented Jan 18, 2018

Copy link
Copy Markdown

A bunch of minor mostly-style changes organized in several commits for ease of cherry-picking.

  1. Use a triple-quoted string for the help message. On the one hand this should be more idiomatic, on the other hand this needs a combination of textwrap.dedent and .indent to keep it pretty, and the latter is missing in python 2. Also, the change adds a newline at the end of the help string, but the chat engine should ignore that.
  2. Use format strings where possible (TODO: f-strings once 3.6 is the new norm ;)
  3. Use context managers for the data files.
  4. Add explicit elifs to chained mutually exclusive ifs. Some of these are extra redundant because there are return statements interspersed, it's a matter of personal taste whether explicit elifs aid readability.
  5. Use advanced iterable unpacking to make head|rest and garbage|tail kind of list separations a bit more convenient.

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