You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
22 lines
461 B
Python
22 lines
461 B
Python
"""This program is self-checking!"""
|
|
|
|
|
|
class C:
|
|
def sort(self, l, reverse, key_fn):
|
|
# PyPy example of CALL_METHOD_KW 2
|
|
# 2 keyword arguments and no positional arguments
|
|
return l.sort(reverse=reverse, key=key_fn)
|
|
|
|
|
|
def lcase(s):
|
|
return s.lower()
|
|
|
|
|
|
x = C()
|
|
l = ["xyz", "ABC"]
|
|
|
|
# An PyPy example of CALL_METHOD_KW 3
|
|
# 2 keyword arguments and one positional argument
|
|
x.sort(l, reverse=False, key_fn=lcase)
|
|
assert l == ["ABC", "xyz"]
|