Fraction: Restore __str__ for Python

The Python code expects __str__() on a Fraction to return a
"{num}:{den}" representation, which __repr__() no longer does.
This commit is contained in:
FeRD (Frank Dana)
2021-01-02 18:33:39 -05:00
parent aed0052399
commit 37bb2f6f9f

View File

@@ -206,7 +206,7 @@
return map1;
}
/* Display methods */
const std::string __string__() {
const std::string __str__() {
std::ostringstream result;
result << $self->num << ":" << $self->den;
return result.str();