Given a class:
class TCurrency {
TCurrency();
TCurrency(long);
TCurrency(const std::string);
...
};
Wrapped with Boost.Python:
class_<TCurrency>( "TCurrency" )
.def( init<long> )
.def( init<const std::string&> )
...
;
Is it possible to create a factory method that appears as a constructor in Python:
TCurrency TCurrency_from_Foo( const Foo& ) { return TCurrency(); }
Such that in python:
bar = TCurrency(foo)