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

Switch type comparisons from == to is, and upgrade flake8, in preparation for Python 3.12 #2857

Merged
merged 1 commit into from
Aug 11, 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
6 changes: 3 additions & 3 deletions parsl/dataflow/memoization.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def id_for_memo_pickle(obj: object, output_ref: bool = False) -> bytes:

@id_for_memo.register(list)
def id_for_memo_list(denormalized_list: list, output_ref: bool = False) -> bytes:
if type(denormalized_list) != list:
if type(denormalized_list) is not list:
raise ValueError("id_for_memo_list cannot work on subclasses of list")

normalized_list = []
Expand All @@ -73,7 +73,7 @@ def id_for_memo_list(denormalized_list: list, output_ref: bool = False) -> bytes

@id_for_memo.register(tuple)
def id_for_memo_tuple(denormalized_tuple: tuple, output_ref: bool = False) -> bytes:
if type(denormalized_tuple) != tuple:
if type(denormalized_tuple) is not tuple:
raise ValueError("id_for_memo_tuple cannot work on subclasses of tuple")

normalized_list = []
Expand All @@ -91,7 +91,7 @@ def id_for_memo_dict(denormalized_dict: dict, output_ref: bool = False) -> bytes
When output_ref=True, the values are normalised as output refs, but
the keys are not.
"""
if type(denormalized_dict) != dict:
if type(denormalized_dict) is not dict:
raise ValueError("id_for_memo_dict cannot work on subclasses of dict")

keys = sorted(denormalized_dict)
Expand Down
2 changes: 1 addition & 1 deletion parsl/tests/integration/test_channels/test_ssh_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def test_error_1():
try:
connect_and_list("bad.url.gov", "ubuntu")
except Exception as e:
assert type(e) == SSHException, "Expected SSException, got: {0}".format(e)
assert type(e) is SSHException, "Expected SSException, got: {0}".format(e)


def test_error_2():
Expand Down
2 changes: 1 addition & 1 deletion parsl/tests/test_bash_apps/test_keyword_overlaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

@parsl.bash_app
def my_app(cache=7):
assert type(cache) == int
assert type(cache) is int
return "true"


Expand Down
2 changes: 1 addition & 1 deletion test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
flake8==6.0.0
flake8==6.1.0
ipyparallel
pandas
pytest>=7.4.0,<8
Expand Down
Loading