cpython/Lib/test/shadowed_super.py
Carl Meyer 0dc8b50d33
gh-87729: add LOAD_SUPER_ATTR instruction for faster super() (#103497)
This speeds up `super()` (by around 85%, for a simple one-level
`super().meth()` microbenchmark) by avoiding allocation of a new
single-use `super()` object on each use.
2023-04-24 22:22:14 +00:00

8 lines
97 B
Python

class super:
msg = "truly super"
class C:
def method(self):
return super().msg