Message7529
i.e.:
class Foo(object):
class bar(object):
bat = "hi"
from operator import attrgetter
print attrgetter("bar.bat")(Foo)
this is a pure Python workaround:
def dottedgetter(attr):
def g(obj):
for name in attr.split("."):
obj = getattr(obj, name)
return obj
return g |
|
Date |
User |
Action |
Args |
2012-11-19 16:34:27 | zzzeek | set | recipients:
+ zzzeek |
2012-11-19 16:34:27 | zzzeek | set | messageid: <1353342867.03.0.989221952212.issue1990@psf.upfronthosting.co.za> |
2012-11-19 16:34:26 | zzzeek | link | issue1990 messages |
2012-11-19 16:34:26 | zzzeek | create | |
|