mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
GH-101100: Fix reference warnings for `__getitem__
` (#110118)
This commit is contained in:
parent
d144749914
commit
da99133710
20 changed files with 38 additions and 38 deletions
|
@ -306,7 +306,7 @@ expect a function argument.
|
|||
itemgetter(*items)
|
||||
|
||||
Return a callable object that fetches *item* from its operand using the
|
||||
operand's :meth:`__getitem__` method. If multiple items are specified,
|
||||
operand's :meth:`~object.__getitem__` method. If multiple items are specified,
|
||||
returns a tuple of lookup values. For example:
|
||||
|
||||
* After ``f = itemgetter(2)``, the call ``f(r)`` returns ``r[2]``.
|
||||
|
@ -326,7 +326,7 @@ expect a function argument.
|
|||
return tuple(obj[item] for item in items)
|
||||
return g
|
||||
|
||||
The items can be any type accepted by the operand's :meth:`__getitem__`
|
||||
The items can be any type accepted by the operand's :meth:`~object.__getitem__`
|
||||
method. Dictionaries accept any :term:`hashable` value. Lists, tuples, and
|
||||
strings accept an index or a slice:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue