This commit also includes a fix to the `var-6.2-instance-speciallookup.py`
test originally added by 82db5c8 / #16806, as the `__getattr__` method
actually does not trigger a class's special lookups flag as originally
believed.
Signed-off-by: Anson Mansfield <amansfield@mantaro.com>
23 lines
239 B
Python
23 lines
239 B
Python
import bench
|
|
|
|
|
|
class Foo:
|
|
pass
|
|
|
|
|
|
def test(num):
|
|
o = Foo()
|
|
|
|
def get():
|
|
try:
|
|
return o.num
|
|
except AttributeError:
|
|
return num
|
|
|
|
i = 0
|
|
while i < get():
|
|
i += 1
|
|
|
|
|
|
bench.run(test)
|