So I have a dictionary on python:
structure = dict()
and I would like to know how I could achieve something like that:
structure.my_func(parameters);
Where my_func
is my custom function.
So I in some way extend it's functionality, I knew we could do that in javascript with prototypes.
Is it possible on python? If yes, how?
Thanks in advance.
dict
class. This subclass can then have your custom attributes and methods.dict
:class my_dict(dict):