@@ -59,15 +59,15 @@ def __eq__(self, other: Any) -> bool:
59
59
60
60
return (
61
61
isinstance (other , self .__base__ ()) and
62
- all ([ getattr (other , key ) == getattr (self , key ) for key in self .__slots__ if key != '_hash' ] )
62
+ all (getattr (other , key ) == getattr (self , key ) for key in self .__slots__ if key != '_hash' )
63
63
)
64
64
65
65
def __ne__ (self , other : Any ) -> bool :
66
66
"""Equal."""
67
67
68
68
return (
69
69
not isinstance (other , self .__base__ ()) or
70
- any ([ getattr (other , key ) != getattr (self , key ) for key in self .__slots__ if key != '_hash' ] )
70
+ any (getattr (other , key ) != getattr (self , key ) for key in self .__slots__ if key != '_hash' )
71
71
)
72
72
73
73
def __hash__ (self ) -> int :
@@ -112,9 +112,9 @@ def _validate(self, arg: dict[Any, Any] | Iterable[tuple[Any, Any]]) -> None:
112
112
"""Validate arguments."""
113
113
114
114
if isinstance (arg , dict ):
115
- if not all ([ isinstance (v , Hashable ) for v in arg .values ()] ):
115
+ if not all (isinstance (v , Hashable ) for v in arg .values ()):
116
116
raise TypeError (f'{ self .__class__ .__name__ } values must be hashable' )
117
- elif not all ([ isinstance (k , Hashable ) and isinstance (v , Hashable ) for k , v in arg ] ):
117
+ elif not all (isinstance (k , Hashable ) and isinstance (v , Hashable ) for k , v in arg ):
118
118
raise TypeError (f'{ self .__class__ .__name__ } values must be hashable' )
119
119
120
120
def __iter__ (self ) -> Iterator [Any ]:
@@ -157,9 +157,9 @@ def _validate(self, arg: dict[str, str] | Iterable[tuple[str, str]]) -> None:
157
157
"""Validate arguments."""
158
158
159
159
if isinstance (arg , dict ):
160
- if not all ([ isinstance (v , str ) for v in arg .values ()] ):
160
+ if not all (isinstance (v , str ) for v in arg .values ()):
161
161
raise TypeError (f'{ self .__class__ .__name__ } values must be hashable' )
162
- elif not all ([ isinstance (k , str ) and isinstance (v , str ) for k , v in arg ] ):
162
+ elif not all (isinstance (k , str ) and isinstance (v , str ) for k , v in arg ):
163
163
raise TypeError (f'{ self .__class__ .__name__ } keys and values must be Unicode strings' )
164
164
165
165
@@ -175,9 +175,9 @@ def _validate(self, arg: dict[str, str] | Iterable[tuple[str, str]]) -> None:
175
175
"""Validate arguments."""
176
176
177
177
if isinstance (arg , dict ):
178
- if not all ([ isinstance (v , str ) for v in arg .values ()] ):
178
+ if not all (isinstance (v , str ) for v in arg .values ()):
179
179
raise TypeError (f'{ self .__class__ .__name__ } values must be hashable' )
180
- elif not all ([ isinstance (k , str ) and isinstance (v , str ) for k , v in arg ] ):
180
+ elif not all (isinstance (k , str ) and isinstance (v , str ) for k , v in arg ):
181
181
raise TypeError (f'{ self .__class__ .__name__ } keys and values must be Unicode strings' )
182
182
183
183
@@ -367,7 +367,7 @@ def __init__(
367
367
"""Initialize."""
368
368
369
369
super ().__init__ (
370
- selectors = tuple (selectors ) if selectors is not None else tuple (),
370
+ selectors = tuple (selectors ) if selectors is not None else (),
371
371
is_not = is_not ,
372
372
is_html = is_html
373
373
)
0 commit comments