cf.Variable.getattr

Variable.getattr(attr, *default)[source]

Get a named attribute.

f.getattr(attr, *default) is equivalent to getattr(f, attr, *default).

Parameters :
attr : str

The attribute’s name.

default : optional

When a default argument is given, it is returned when the attribute doesn’t exist; without it, an exception is raised in that case.

Returns :
out :

The attribute’s value.

Examples

>>> f.foo = -99
>>> fl.getattr('foo')
-99
>>> del f.foo
>>> fl.getattr('foo', 'bar')
'bar'

Previous topic

cf.Variable.flip

Next topic

cf.Variable.getprop

This Page