← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #230529]: Region subclass inheritance loop

 

Question #230529 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/230529

    Status: Answered => Open

Matthew Arnold is still having a problem:
The goal is not to have the popups-- they're just here to illustrate
that a call to my method dupeFind will result in infinite calls to my
method find.

Since you seem to be suggesting alternate solutions, let me briefly
justify mine: the purpose of this part of the code is to override the
inherited find, casting the results of a call to the inherited find to a
MyRegion object. With subclassing, I don't have to write passthroughs
for everything-- only for a few things, like this, where I want objects
of my own class coming back. With wrapper classing as you've shown,  I'd
have to wrap everything, so subclassing seems like the sensible
solution. And a note on why the code looks lean and pointless: my code
is a portion of my ~130 line MyRegion class that we're using in our
testing framework but is enough to illustrate the weird infinite loop,
so I haven't included the other, meatier overrides and extra methods.

So the original question: Is it a problem in Jython, Sikuli, or my code
that if we run the following (substitute sensible code for ellipses):

aRegion = find(...)
aMyRegion = MyRegion(aRegion)
aMyRegion.dupeFind(...)

We get an infinite loop? There's got to be some sensible way to delegate
to the parent class without storing an instance of one (which defeats
the point of subclassing).

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.