Boost logo

Boost :

From: Ralf W. Grosse-Kunstleve (rwgk_at_[hidden])
Date: 2001-08-16 14:33:00

> What's going on with this? Any other name besides 'print' works fine
> here. Is this because the Order::print method (which I am not
> exposing to python) is somehow clashing??

"print" is a reserved Python keyword and cannot be used as an identifier
for function names, including method names.

I could not read the attachment with the compiler error messages.
In general, it is possible to expose functions with optional
arguments. However, the default arguments are lost at the Python
level. Therefore I usually define *free* C++ functions, e.g.:

  bool SgOps_isValidPhase_rad_2(const SgOps& sgo,
                                const Miller::Index& H, double phi) {
    return sgo.isValidPhase_rad(H, phi);
  bool SgOps_isValidPhase_rad_3(const SgOps& sgo,
                                const Miller::Index& H, double phi,
                                double tolerance) {
    return sgo.isValidPhase_rad(H, phi, tolerance);

The Python bindings are defined as:

    py_SgOps.def(SgOps_isValidPhase_rad_2, "isValidPhase_rad");
    py_SgOps.def(SgOps_isValidPhase_rad_3, "isValidPhase_rad");
    py_SgOps.def(&SgOps::epsilon, "epsilon");

This third binding is just to show the difference to "normal"


P.S.: Improvements have been discussed but are not implemented:

Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger

Boost list run by bdawes at, gregod at, cpdaniel at, john at