Skip to content

[c++2py] TRIQS/unstable - NB5 Wrapping Problem #6

Description

@Wentzell

I used an example out of cpp2py/5-Parameters.ipynb together with TRIQS/unstable.

I found that wrapping the following params class

%%triqs
​
struct params{ 
 int i;
 double x=0; 
 params(){}  // default 
};
​
double f(params const & a) {
 return a.i + a.x;   
}

and using it from the notebook​

p = Params()
p.i, p.x = 1, 2.9
print p.i
print f(p)

fails with

---------------------------------------------------------------------------TypeError
Traceback (most recent call last)
<ipython-input-5-64e6831a17a4> in <module>()
----> 1 p = Params()
      2 p.i, p.x = 1, 2.9
      3 print p.i
      4 print f(p)

TypeError: cannot create 'ext.ext.Params' instances

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions