meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
programming:python:oop [2024/01/02 10:33] niziakprogramming:python:oop [2024/01/03 11:34] (current) niziak
Line 58: Line 58:
   * **property** - properties are methods accessed like attributes. It gives full control on its getter, setter and deleter access.   * **property** - properties are methods accessed like attributes. It gives full control on its getter, setter and deleter access.
  
 +
 +**delattr(object, name)**
 +This is a relative of ''setattr()''. The arguments are an object and a string. The string must be the name of one of the object’s attributes. The function deletes the named attribute, provided the object allows it. For example, ''delattr(x, 'foobar')'' is equivalent to ''del x.foobar''. name need not be a Python identifier (see setattr()).
 +
 +
 +===== Object-like attribute access for nested dictionary =====
 +  * https://stackoverflow.com/questions/38034377/object-like-attribute-access-for-nested-dictionary
 +  * https://bobbyhadz.com/blog/python-use-dot-to-access-dictionary
 +  * https://github.com/frmdstryr/magicattr