Next / Previous / Contents / TCC Help System / NM Tech homepage

21.4. delattr(): Delete a named attribute

Use this function to delete an attribute named A of some instance I. It does not return a value. Here is the general form:

delattr(I, A)

For example, if an instance seabiscuit has a rider attribute, this statement would delete that attribute:

delattr(seabiscuit, 'rider')

If the instance has no such attribute, this function will raise an AttributeError exception.