Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crpropa Modules implemented in python cannot change the __init__ function #9

Closed
DavidWalz opened this issue May 30, 2014 · 2 comments
Closed

Comments

@DavidWalz
Copy link
Member

from crpropa import *
class Test(Module):
   def __init__ (self):
      pass

m = ModuleList()
m.add(Test())

TypeError: in method 'ModuleList_add', argument 2 of type 'crpropa::Module *'

@geromueller
Copy link
Member

You need to call the constructor of the super class:

def init (self):
Module.init(self)

Am Donnerstag, 29. Mai 2014, 23:54:34 schrieb DavidWalz:

from crpropa import *
class Test(Module):
   def __init__ (self):
      pass

m = ModuleList()
m.add(Test())

TypeError: in method 'ModuleList_add', argument 2 of type 'crpropa::Module
*'


Reply to this email directly or view it on GitHub:
#9

@DavidWalz
Copy link
Member Author

Right. I'll add it to the wiki.

from crpropa import *
class Test(Module):
   def __init__ (self):
      Module.__init__(self)

m = ModuleList()
m.add(Test())

@lyang54 lyang54 mentioned this issue Nov 17, 2017
TobiasWinchen pushed a commit that referenced this issue Apr 16, 2020
Add example for confirming Liouville's theorem
adundovi pushed a commit that referenced this issue Nov 15, 2021
reichherzerp pushed a commit to reichherzerp/CRPropa3 that referenced this issue Dec 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants