isinstance(Region) vs. isinstance(Region.nearby) not giving the same result
Hello,
Tried to search for an answer but did not find anything satisfactory but I'm kinda bad at Internet search (so sorry if an answer already exists)
Here is my problem:
I'm trying to write some function that performs specific processing based on parameter type (mainly Match or Region).
No problem with Match, but Region seems a bit more tricky so I dug a bit more and found out that there seems to have several types of Region, depending where it comes from.
This code (with Sikuli 1.0.1):
from sikuli import *
reg = Region(1,1,100,100)
print "Is reg a Region?"
if isinstance(reg, Region):print "yes, a Region"
else:print "nope, not a Region"
print "Is reg.nearby(5) a Region?"
if isinstance(
else:print "nope, not a Region"
gives
Is reg a Region?
yes, a Region
Is reg.nearby(5) a Region?
nope, not a Region
Seeing this result (which seems strange as documentation says that nearby() "Returns a new Region"), I tried this
print "reg class=%
print "reg.nearby(5) class=%
and got
reg class=<class 'sikuli.
reg.nearby(5) class=<type 'org.sikuli.
So, here comes the question: what am I doing wrong to get reg.nearby(5) not being a Region?
Thanks in advance
Romuald
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- RaiMan
- Solved:
- Last query:
- Last reply: