← Back to team overview

sikuli-driver team mailing list archive

[Question #230529]: Region subclass inheritance loop

 

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

I'm trying to make a subclass of Region. Here's the relevant code:

class MyRegion(Region):
    def __init__(self, region, regionName = "noNameDefined"):
        super(MyRegion, self).__init__(region)
        self.name = regionName

(...)

    def find(self, ps):
        popup("about to find something")
        return super(MyRegion, self).find(ps)
        popup("found something")
    def dupeFind(self, ps):
        popup("about to find something in dupe")
        return super(MyRegion, self).find(ps)
        popup("found something in dupe")

When I call my dupeFind method, I expect it to pass the call on to the superclass and return a match. What happens instead is that execution goes to the find method above it, which then calls itself indefinitely until I get a "RuntimeError ( maximum recursion depth exceeded )" since the recursion has busted the stack.

What's going wrong?

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