E
Emmanuel Briot
I am participating in the development of a GPL IDE
https://libre2.adacore.com/gps/
It is written in Ada, but provides an extensive extensibility through
Python.
I am not really good at python, but I was trying to implement the
singleton design pattern in C, so that for instance calling the constructor
ed = Editor ("foo")
would either return an existing instance of Editor currently editing
"foo", or would create a new instance. Basically, one python instance is
stored inside each of the visual windows representing an editor, and I
want to get that instance if it already exists, instead of creating a
new one each time.
I basically would like
ed = Editor ("foo")
ed.attribute = "whatever"
print Editor ("foo").attribute
to print "whatever"
Has any one an example on how to do that in C, or maybe even at the
python level itself, and I will try to adapt it ?
Thanks in advance
Emmanuel
https://libre2.adacore.com/gps/
It is written in Ada, but provides an extensive extensibility through
Python.
I am not really good at python, but I was trying to implement the
singleton design pattern in C, so that for instance calling the constructor
ed = Editor ("foo")
would either return an existing instance of Editor currently editing
"foo", or would create a new instance. Basically, one python instance is
stored inside each of the visual windows representing an editor, and I
want to get that instance if it already exists, instead of creating a
new one each time.
I basically would like
ed = Editor ("foo")
ed.attribute = "whatever"
print Editor ("foo").attribute
to print "whatever"
Has any one an example on how to do that in C, or maybe even at the
python level itself, and I will try to adapt it ?
Thanks in advance
Emmanuel