Skip to content

Commit

Permalink
Adjust positional arguments flagged by flake8-bugbear
Browse files Browse the repository at this point in the history
The new release of flake8-bugbear is starting to flag positional argument unpacking that comes after keyword arguments in function calls as a style warning that fails.  This is a good thing to catch because it can lead to unexpected side effects with function arguments and/or errors thrown by Python.

See the following links for more details:

- https://stackoverflow.com/questions/58961715/python-value-unpacking-order-in-method-parameters
- python/cpython#82741

This changeset fixes a couple of instances where the positional argument unpacking was happening after keyword arguments were being provided.

Signed-off-by: Carlo Costino <carlo.costino@gsa.gov>
  • Loading branch information
ccostino committed Nov 28, 2023
1 parent 6556c14 commit 541ee96
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/main/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -956,9 +956,9 @@ def __init__(self, label, choices=None, *args, **kwargs):
]
super().__init__(
label,
*args,
choices=choices,
thing=f"{choices[0][1].lower()} or {choices[1][1].lower()}",
*args,
**kwargs,
)

Expand Down
2 changes: 1 addition & 1 deletion app/notify_client/status_api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

class StatusApiClient(NotifyAdminAPIClient):
def get_status(self, *params):
return self.get(url="/_status", *params)
return self.get(*params, url="/_status")

@cache.set("live-service-and-organization-counts", ttl_in_seconds=3600)
def get_count_of_live_services_and_organizations(self):
Expand Down

0 comments on commit 541ee96

Please sign in to comment.