Leo's TDD design involves imp.reload 
<https://docs.python.org/3/library/imp.html>.  Alas, *imp.reload affects 
super calls!*

This glitch cost me a lot of time last night.  The workaround was to use 
this pattern, which could be called a form of documentation, and a warning:

if g.isPython3:
    super().__init__(*args to ctor*)
else:
    # In subclasses:
    super(self.__class__, self).__init__(*args to ctor*)
    # In the Label base class:
    QtWidgets.QLabel.__init__(self, *args to ctor*)

This kind of pattern verges on the intolerable. The python 2 part is a 
revolting mess.

There have been a number of stack overflow discussions, some of which are 
contradictory! This one 
<http://stackoverflow.com/questions/9722343/python-super-behavior-not-dependable>
 
seems most useful, but it's not the full story.

Edward

-- 
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 https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to