You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am unable to call a virtual function (implemented in python) from that virtual function in another object. It looks like there is code in get_overload that compares function names and returns a null function if it matches. I suppose this was added to prevent infinite looping (?), but results in false positives.
import mytest as my
class PyClass1(my.Base):
def __init__(self):
my.Base.__init__(self)
def Print(self):
print("In PyClass1")
class PyClass2(my.Base):
def __init__(self):
my.Base.__init__(self)
def Print(self):
print("In PyClass2")
p = PyClass1()
my.CallPrint(p) # <<< Problem here
b = PyClass2()
my.CallPrint(b)
Error is RuntimeError: Tried to call pure virtual function "Print"
The text was updated successfully, but these errors were encountered:
wjakob
changed the title
Calling virtual function from another with the same name
Virtual function dispatch has problems with similar-named functions
Apr 11, 2016
I am unable to call a virtual function (implemented in python) from that virtual function in another object. It looks like there is code in
get_overload
that compares function names and returns a null function if it matches. I suppose this was added to prevent infinite looping (?), but results in false positives.Small example: Cpp File:
Python:
Error is
RuntimeError: Tried to call pure virtual function "Print"
The text was updated successfully, but these errors were encountered: