Commit eb988c7ede362cae9b444b60eca60074a9804fdc
1 parent
fecc1674
Add Python 3.x division operator
Showing
1 changed file
with
5 additions
and
0 deletions
pyext/GTime.i
| ... | ... | @@ -77,9 +77,14 @@ public: |
| 77 | 77 | GTime __mul__(const double& factor) const { |
| 78 | 78 | return ((*self) * factor); |
| 79 | 79 | } |
| 80 | + // Python 2.x | |
| 80 | 81 | GTime __div__(const double& factor) const { |
| 81 | 82 | return ((*self) / factor); |
| 82 | 83 | } |
| 84 | + // Python 3.x | |
| 85 | + GTime __truediv__(const double& factor) const { | |
| 86 | + return ((*self) / factor); | |
| 87 | + } | |
| 83 | 88 | bool __eq__(const GTime& time) const { |
| 84 | 89 | return ((*self) == time); |
| 85 | 90 | } | ... | ... |