micropython-lib/operator/test_operator.py

8 wiersze
107 B
Python

import operator
class A: pass
a = A()
a.name = "foo"
f = operator.attrgetter('name')
assert f(a) == "foo"