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
Hi,
I have been trying to create a sub class inheriting from DynGraph to implement some desired functionality:
import dynetx as dn
class myDynGraph(dn.DynGraph):
# custom new method
def myMethod(self):
pass
but when I instantiate the new class G = myDynGraph(), I have the following error:
File "/home/glarrea/miniconda3/envs/this_is_a_test_dev/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 3417, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-4-da889620d25d>", line 1, in <module>
a = myGraph()
File "/home/glarrea/miniconda3/envs/this_is_a_test_dev/lib/python3.8/site-packages/dynetx/classes/dyngraph.py", line 121, in __init__
super(self.__class__, self).__init__(data, **attr)
File "/home/glarrea/miniconda3/envs/this_is_a_test_dev/lib/python3.8/site-packages/dynetx/classes/dyngraph.py", line 121, in __init__
super(self.__class__, self).__init__(data, **attr)
File "/home/glarrea/miniconda3/envs/this_is_a_test_dev/lib/python3.8/site-packages/dynetx/classes/dyngraph.py", line 121, in __init__
super(self.__class__, self).__init__(data, **attr)
[Previous line repeated 2981 more times]
RecursionError: maximum recursion depth exceeded while calling a Python object
Modifying line 121 of dynetx/classes/dyngraph.py from :
121 super(self.__class__, self).__init__(data, **attr)
to:
121 super(DynGraph, self).__init__(data, **attr) worked for me.
Is there another way of inheriting without modifying the source code?
Thank you for the answer,
Gustavo
The text was updated successfully, but these errors were encountered:
Hi,
I have been trying to create a sub class inheriting from DynGraph to implement some desired functionality:
but when I instantiate the new class
G = myDynGraph()
, I have the following error:Modifying line 121 of dynetx/classes/dyngraph.py from :
121
super(self.__class__, self).__init__(data, **attr)
to:
121
super(DynGraph, self).__init__(data, **attr)
worked for me.Is there another way of inheriting without modifying the source code?
Thank you for the answer,
Gustavo
The text was updated successfully, but these errors were encountered: