@@ -126,8 +126,8 @@ def signature(obj):
126
126
new_params [arg_name ] = param .replace (default = arg_value ,
127
127
_partial_kwarg = True )
128
128
129
- elif (param .kind not in (_VAR_KEYWORD , _VAR_POSITIONAL ) and
130
- not param ._partial_kwarg ):
129
+ elif (param .kind not in (_VAR_KEYWORD , _VAR_POSITIONAL )
130
+ and not param ._partial_kwarg ):
131
131
new_params .pop (arg_name )
132
132
133
133
return sig .replace (parameters = new_params .values ())
@@ -333,11 +333,11 @@ def __hash__(self):
333
333
raise TypeError (msg )
334
334
335
335
def __eq__ (self , other ):
336
- return (issubclass (other .__class__ , Parameter ) and
337
- self ._name == other ._name and
338
- self ._kind == other ._kind and
339
- self ._default == other ._default and
340
- self ._annotation == other ._annotation )
336
+ return (issubclass (other .__class__ , Parameter )
337
+ and self ._name == other ._name
338
+ and self ._kind == other ._kind
339
+ and self ._default == other ._default
340
+ and self ._annotation == other ._annotation )
341
341
342
342
def __ne__ (self , other ):
343
343
return not self .__eq__ (other )
@@ -372,8 +372,8 @@ def signature(self):
372
372
def args (self ):
373
373
args = []
374
374
for param_name , param in self ._signature .parameters .items ():
375
- if (param .kind in (_VAR_KEYWORD , _KEYWORD_ONLY ) or
376
- param ._partial_kwarg ):
375
+ if (param .kind in (_VAR_KEYWORD , _KEYWORD_ONLY )
376
+ or param ._partial_kwarg ):
377
377
# Keyword arguments mapped by 'functools.partial'
378
378
# (Parameter._partial_kwarg is True) are mapped
379
379
# in 'BoundArguments.kwargs', along with VAR_KEYWORD &
@@ -402,8 +402,8 @@ def kwargs(self):
402
402
kwargs_started = False
403
403
for param_name , param in self ._signature .parameters .items ():
404
404
if not kwargs_started :
405
- if (param .kind in (_VAR_KEYWORD , _KEYWORD_ONLY ) or
406
- param ._partial_kwarg ):
405
+ if (param .kind in (_VAR_KEYWORD , _KEYWORD_ONLY )
406
+ or param ._partial_kwarg ):
407
407
kwargs_started = True
408
408
else :
409
409
if param_name not in self .arguments :
@@ -432,9 +432,9 @@ def __hash__(self):
432
432
raise TypeError (msg )
433
433
434
434
def __eq__ (self , other ):
435
- return (issubclass (other .__class__ , BoundArguments ) and
436
- self .signature == other .signature and
437
- self .arguments == other .arguments )
435
+ return (issubclass (other .__class__ , BoundArguments )
436
+ and self .signature == other .signature
437
+ and self .arguments == other .arguments )
438
438
439
439
def __ne__ (self , other ):
440
440
return not self .__eq__ (other )
@@ -612,9 +612,9 @@ def __hash__(self):
612
612
raise TypeError (msg )
613
613
614
614
def __eq__ (self , other ):
615
- if (not issubclass (type (other ), Signature ) or
616
- self .return_annotation != other .return_annotation or
617
- len (self .parameters ) != len (other .parameters )):
615
+ if (not issubclass (type (other ), Signature )
616
+ or self .return_annotation != other .return_annotation
617
+ or len (self .parameters ) != len (other .parameters )):
618
618
return False
619
619
620
620
other_positions = dict ((param , idx )
@@ -635,8 +635,8 @@ def __eq__(self, other):
635
635
except KeyError :
636
636
return False
637
637
else :
638
- if (idx != other_idx or
639
- param != other .parameters [param_name ]):
638
+ if (idx != other_idx
639
+ or param != other .parameters [param_name ]):
640
640
return False
641
641
642
642
return True
@@ -688,8 +688,8 @@ def _bind(self, args, kwargs, partial=False):
688
688
raise TypeError (msg )
689
689
parameters_ex = (param ,)
690
690
break
691
- elif (param .kind == _VAR_KEYWORD or
692
- param .default is not _empty ):
691
+ elif (param .kind == _VAR_KEYWORD
692
+ or param .default is not _empty ):
693
693
# That's fine too - we have a default value for this
694
694
# parameter. So, lets start parsing `kwargs`, starting
695
695
# with the current parameter
@@ -755,8 +755,8 @@ def _bind(self, args, kwargs, partial=False):
755
755
# if it has a default value, or it is an '*args'-like
756
756
# parameter, left alone by the processing of positional
757
757
# arguments.
758
- if (not partial and param .kind != _VAR_POSITIONAL and
759
- param .default is _empty ):
758
+ if (not partial and param .kind != _VAR_POSITIONAL
759
+ and param .default is _empty ):
760
760
raise TypeError ('{arg!r} parameter lacking default value' .
761
761
format (arg = param_name ))
762
762
0 commit comments