Say i am using a class from some python package that looks like the following
class foo(object):
def __init__(self):
self.a = None
self.b = None
self.c = None
self.d = None
self.e = None
self.f = None
Now I need to use attributes b
, d
, and e
of object foobar of class foo in some operation, say call a function qux for instance:
print qux(foobar.b, foobar.d, foobar.e)
Is there any way to create a shorthand version of this, something like the following imagined code:
print qux(*foobar.[b,d,e])
Note the constraints: neither the class nor the function can be changed.