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

style: Compare Python types with is, not == #218

Merged
merged 1 commit into from
Aug 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions localstripe/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def try_convert_to_bool(arg):


def try_convert_to_int(arg):
if type(arg) == int:
if type(arg) is int:
return arg
elif type(arg) in (str, float):
try:
Expand All @@ -93,7 +93,7 @@ def try_convert_to_int(arg):


def try_convert_to_float(arg):
if type(arg) == float:
if type(arg) is float:
return arg
elif type(arg) in (str, int):
try:
Expand Down
2 changes: 1 addition & 1 deletion localstripe/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ async def auth_middleware(request, handler):
data = unflatten_data(request.query)

if not is_auth and accept_key_in_post_data:
if ('key' in data and type(data['key']) == str and
if ('key' in data and type(data['key']) is str and
data['key'].startswith('pk_')):
is_auth = True

Expand Down
Loading