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

Adapt to some recent flake8/pycodestyle changes #4867

Merged
merged 3 commits into from
Jul 31, 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 beets/autotag/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from collections import namedtuple
from functools import total_ordering
import re
from typing import Dict, List, Tuple, Iterator, Union, Any, Optional,\
from typing import Dict, List, Tuple, Iterator, Union, Any, Optional, \
Iterable, Callable, cast

from beets import logging
Expand Down
6 changes: 3 additions & 3 deletions beets/dbcore/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def __repr__(self) -> str:
return f"{self.__class__.__name__}()"

def __eq__(self, other) -> bool:
return type(self) == type(other)
return type(self) is type(other)

def __hash__(self) -> int:
"""Minimalistic default implementation of a hash.
Expand Down Expand Up @@ -868,7 +868,7 @@ def __hash__(self) -> int:
return 0

def __eq__(self, other) -> bool:
return type(self) == type(other)
return type(self) is type(other)


class MultipleSort(Sort):
Expand Down Expand Up @@ -1014,7 +1014,7 @@ def __bool__(self) -> bool:
return False

def __eq__(self, other) -> bool:
return type(self) == type(other) or other is None
return type(self) is type(other) or other is None

def __hash__(self) -> int:
return 0
2 changes: 1 addition & 1 deletion beets/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1363,7 +1363,7 @@ def _freshen_items(items):

def _extend_pipeline(tasks, *stages):
# Return pipeline extension for stages with list of tasks
if type(tasks) == list:
if isinstance(tasks, list):
task_iter = iter(tasks)
else:
task_iter = tasks
Expand Down
4 changes: 2 additions & 2 deletions beetsplug/acousticbrainz.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,11 +323,11 @@ def _data_to_scheme_child(self, subdata, subscheme, composites):
"""
for k, v in subscheme.items():
if k in subdata:
if type(v) == dict:
if isinstance(v, dict):
yield from self._data_to_scheme_child(subdata[k],
v,
composites)
elif type(v) == tuple:
elif isinstance(v, tuple):
composite_attribute, part_number = v
attribute_parts = composites[composite_attribute]
# Parts are not guaranteed to be inserted in order
Expand Down
2 changes: 1 addition & 1 deletion test/test_datequery.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from datetime import datetime, timedelta
import unittest
import time
from beets.dbcore.query import _parse_periods, DateInterval, DateQuery,\
from beets.dbcore.query import _parse_periods, DateInterval, DateQuery, \
InvalidQueryArgumentValueError


Expand Down
2 changes: 1 addition & 1 deletion test/test_mbsync.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import unittest
from unittest.mock import patch

from test.helper import TestHelper,\
from test.helper import TestHelper, \
generate_album_info, \
generate_track_info, \
capture_log
Expand Down
Loading