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

Housekeeping #495

Merged
merged 6 commits into from
Jul 8, 2019
Merged

Housekeeping #495

merged 6 commits into from
Jul 8, 2019

Conversation

marcofucci
Copy link
Contributor

This:

  • adds/corrects a few lines in the README
  • removes unused lines
  • makes sure mutable data structures are not used for arg defaults
  • changes another couple of things

The intention is to eventually add flake8-bugbear and flake8-quotes to mtp_common.

The new version mirrors ProcessNewCreditsForm.credit_choices
Using callables for arg defaults is not recommended; also, this
default was never really used to getting rid of it should be safe.
All calls reuse one instance of that data structure, persisting
changes between them.
flake8-bugbear suggests:
Do not call setattr with a constant attribute value, it is not
any safer than normal property access.

The new version is also easier to read.

This also adds a missing test for the related lines of code.
@marcofucci marcofucci requested a review from ushkarev July 4, 2019 16:20
@marcofucci marcofucci merged commit 0888c8d into master Jul 8, 2019
@marcofucci marcofucci deleted the housekeeping branch July 8, 2019 15:37
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.

None yet

2 participants