diff options
Diffstat (limited to 'contrib/tools/python3/Lib/operator.py')
| -rw-r--r-- | contrib/tools/python3/Lib/operator.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/contrib/tools/python3/Lib/operator.py b/contrib/tools/python3/Lib/operator.py index 30116c1189a..02ccdaa13dd 100644 --- a/contrib/tools/python3/Lib/operator.py +++ b/contrib/tools/python3/Lib/operator.py @@ -239,7 +239,7 @@ class attrgetter: """ __slots__ = ('_attrs', '_call') - def __init__(self, attr, *attrs): + def __init__(self, attr, /, *attrs): if not attrs: if not isinstance(attr, str): raise TypeError('attribute name must be a string') @@ -257,7 +257,7 @@ class attrgetter: return tuple(getter(obj) for getter in getters) self._call = func - def __call__(self, obj): + def __call__(self, obj, /): return self._call(obj) def __repr__(self): @@ -276,7 +276,7 @@ class itemgetter: """ __slots__ = ('_items', '_call') - def __init__(self, item, *items): + def __init__(self, item, /, *items): if not items: self._items = (item,) def func(obj): @@ -288,7 +288,7 @@ class itemgetter: return tuple(obj[i] for i in items) self._call = func - def __call__(self, obj): + def __call__(self, obj, /): return self._call(obj) def __repr__(self): @@ -315,7 +315,7 @@ class methodcaller: self._args = args self._kwargs = kwargs - def __call__(self, obj): + def __call__(self, obj, /): return getattr(obj, self._name)(*self._args, **self._kwargs) def __repr__(self): |
