swat.cas.table.CASTable.__setattr__

CASTable.__setattr__(self, name, value)

Set attribute or parameter value

When an attribute is set on a CASTable object it can end up in one of two locations. If the name of the attribute given matches the name of a CAS table parameter, the attribute value is stored in the CASTable.params dictionary and used in calls to CAS actions.

If the specified name does not match a CAS table parameter, the attribute is set on the CASTable object as a standard Python attribute.

Parameters
namestring

Name of the attribute to set.

valueany

The value of the attribute to set.

Examples

>>> tbl = CASTable('my-table')
>>> tbl.where = 'a < 2'
>>> tbl.noattr = True
>>> print(tbl.where)
'a < 2'
>>> print(tbl.params)
{'name': 'my-table', 'where': 'a < 2'}
>>> print(tbl.noattr)
True