Name

__delattr__

Synopsis

__delattr__(self,name)

At every request to unbind attribute x.y (typically, a del statement del x.y), Python calls x .__delattr__('y'). All the considerations discussed for __setattr__ also apply to __delattr__. Python ignores the return value of __delattr__. If __delattr__ is absent, Python usually translates del x.y into del x .__dict__['y'].

Get Python in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.