diff options
| author | shadchin <[email protected]> | 2022-02-10 16:44:30 +0300 |
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:44:30 +0300 |
| commit | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (patch) | |
| tree | 012bb94d777798f1f56ac1cec429509766d05181 /contrib/tools/python3/src/Lib/operator.py | |
| parent | 6751af0b0c1b952fede40b19b71da8025b5d8bcf (diff) | |
Restoring authorship annotation for <[email protected]>. Commit 1 of 2.
Diffstat (limited to 'contrib/tools/python3/src/Lib/operator.py')
| -rw-r--r-- | contrib/tools/python3/src/Lib/operator.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/contrib/tools/python3/src/Lib/operator.py b/contrib/tools/python3/src/Lib/operator.py index 241fdbb679e..9cc5b89958d 100644 --- a/contrib/tools/python3/src/Lib/operator.py +++ b/contrib/tools/python3/src/Lib/operator.py @@ -155,10 +155,10 @@ def contains(a, b): return b in a def countOf(a, b): - "Return the number of items in a which are, or which equal, b." + "Return the number of items in a which are, or which equal, b." count = 0 for i in a: - if i is b or i == b: + if i is b or i == b: count += 1 return count @@ -173,7 +173,7 @@ def getitem(a, b): def indexOf(a, b): "Return the first index of b in a." for i, j in enumerate(a): - if j is b or j == b: + if j is b or j == b: return i else: raise ValueError('sequence.index(x): x not in sequence') @@ -302,11 +302,11 @@ class methodcaller: """ __slots__ = ('_name', '_args', '_kwargs') - def __init__(self, name, /, *args, **kwargs): - self._name = name + def __init__(self, name, /, *args, **kwargs): + self._name = name if not isinstance(self._name, str): raise TypeError('method name must be a string') - self._args = args + self._args = args self._kwargs = kwargs def __call__(self, obj): |
