On Monday, May 11, 2015 at 6:51:38 AM UTC-5, john lunzer wrote:

Out of curiosity, how do you ensure singleton-ness of the LeoApp class? I 
> didn't see anything special precautions in the class definition.
>

There is nothing special about the LeoApp class.  It simply gets 
instantiated once.

Some people consider singleton's to be bad design.  I agree, if that means 
that being a singleton actually affects the class's code.  In particular, a 
singleton class that uses static methods (without self) is asking for big 
trouble.

That's why I am willing to go to so much trouble to have @cmd decorators be 
able to "reconstitute" the self argument.  Methods that implement Leo 
commands must be first-class methods of their class, not "self-less" 
functions. Many commands use self!

EKR

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to