diff --git a/pyext/GEnergy.i b/pyext/GEnergy.i index c6f0bbc..7d55950 100644 --- a/pyext/GEnergy.i +++ b/pyext/GEnergy.i @@ -97,9 +97,14 @@ public: GEnergy __mul__(const double& factor) const { return ((*self) * factor); } + // Python 2.x GEnergy __div__(const double& factor) const { return ((*self) / factor); } + // Python 3.x + GEnergy __truediv__(const double& factor) const { + return ((*self) / factor); + } bool __eq__(const GEnergy& eng) const { return ((*self) == eng); } diff --git a/pyext/GSkymap.i b/pyext/GSkymap.i index a20073c..429e57e 100644 --- a/pyext/GSkymap.i +++ b/pyext/GSkymap.i @@ -201,12 +201,12 @@ public: } // Python 2.x operator/= GSkymap __idiv__(const GSkymap& map) { - self->operator /=(map); + self->operator/=(map); return (*self); } // Python 3.x operator/= GSkymap __itruediv__(const GSkymap& map) { - self->operator /=(map); + self->operator/=(map); return (*self); } }; diff --git a/pyext/GVector.i b/pyext/GVector.i index 60f4836..7952e83 100755 --- a/pyext/GVector.i +++ b/pyext/GVector.i @@ -1,7 +1,7 @@ /*************************************************************************** * GVector.i - Vector class * * ----------------------------------------------------------------------- * - * copyright (C) 2008-2013 by Juergen Knoedlseder * + * copyright (C) 2008-2014 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -55,7 +55,6 @@ public: GVector& operator+=(const double& value); GVector& operator-=(const double& value); GVector& operator*=(const double& value); - GVector& operator/=(const double& value); GVector operator-(void) const; // Vector functions @@ -105,9 +104,24 @@ public: GVector __mul__(const double &a) { return (*self) * a; } + // Python 2.x GVector __div__(const double &a) { return (*self) / a; } + // Python 3.x + GVector __truediv__(const double &a) { + return (*self) / a; + } + // Python 2.x operator/= + GVector __idiv__(const double& value) { + self->operator/=(value); + return (*self); + } + // Python 3.x operator/= + GVector __itruediv__(const double& value) { + self->operator/=(value); + return (*self); + } int __is__(const GVector &a) { return (*self) == a; }