Fixes #38239 rename parameter of stack.pick()
This commit is contained in:
parent
868e9f9b52
commit
8d0d0de897
|
|
@ -175,21 +175,21 @@ def concat(quote, expression):
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def pick(s, n):
|
def pick(stack, n):
|
||||||
'''
|
'''
|
||||||
Return the nth item on the stack.
|
Return the nth item on the stack.
|
||||||
|
|
||||||
:param stack s: A stack.
|
:param stack stack: A stack.
|
||||||
:param int n: An index into the stack.
|
:param int n: An index into the stack.
|
||||||
:raises ValueError: if ``n`` is less than zero.
|
:raises ValueError: if ``n`` is less than zero.
|
||||||
:raises IndexError: if ``n`` is equal to or greater than the length of ``s``.
|
:raises IndexError: if ``n`` is equal to or greater than the length of ``stack``.
|
||||||
:rtype: whatever
|
:rtype: whatever
|
||||||
'''
|
'''
|
||||||
if n < 0:
|
if n < 0:
|
||||||
raise ValueError
|
raise ValueError
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
item, s = s
|
item, stack = stack
|
||||||
except ValueError:
|
except ValueError:
|
||||||
raise IndexError
|
raise IndexError
|
||||||
n -= 1
|
n -= 1
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue