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

Address flake8 E721 violations #580

Merged
merged 1 commit into from
Sep 12, 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
2 changes: 1 addition & 1 deletion colcon_core/package_augmentation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def update_metadata(desc, key, value):
old_value |= value
return

if type(old_value) != type(value):
if type(old_value) is not type(value):
logger.warning(
f"update package '{desc.name}' metadata '{key}' from value "
f"'{old_value}' to '{value}'")
Expand Down
2 changes: 1 addition & 1 deletion colcon_core/package_descriptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def __hash__(self): # noqa: D105
return hash((self.type, self.name))

def __eq__(self, other): # noqa: D105
if type(self) != type(other):
if type(self) is not type(other):
return NotImplemented
if (self.type, self.name) != (other.type, other.name):
return False
Expand Down
2 changes: 1 addition & 1 deletion colcon_core/verb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def update_object(
return

severity = 5 \
if old_value is None or type(old_value) == type(value) \
if old_value is None or type(old_value) is type(value) \
else logging.WARNING
logger.log(
severity, f"overwrite package '{package_name}' {argument_type} "
Expand Down
4 changes: 2 additions & 2 deletions test/test_argument_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ def test_argument_default():
unwrap_default_value(value)
default_value = wrap_default_value(value)
assert is_default_value(default_value)
assert type(default_value) != type(value)
assert type(default_value) is not type(value)
with pytest.raises(ValueError):
wrap_default_value(default_value)
unwrapped_value = unwrap_default_value(default_value)
assert value == unwrapped_value

value = 42
unchanged_value = wrap_default_value(value)
assert type(unchanged_value) == type(value)
assert type(unchanged_value) is type(value)
assert unchanged_value == value