aldebjer / pysim

Modelling and Simulation of Dynamical Systems
https://pysim.org
BSD 3-Clause "New" or "Revised" License
10 stars 1 forks source link

Inheriting in python from CPP system naming issue #9

Closed freol35241 closed 7 years ago

freol35241 commented 7 years ago

If inheriting in python from a pysim c++ system the python class needs to have the same name as the c++ system class otherwise pysim throws an error when initializing the system.

A workaround is to manually set the class name in python: Class.__name__ = 'CPPsystemname'

or even sneakier:

obj = Class()
obj.__class__.__name__ = 'CPPsystemname'
aldebjer commented 7 years ago

Lets not be sneaky :)