Skip to content

Commit

Permalink
Fraction: Restore __string__ for Python
Browse files Browse the repository at this point in the history
The Python code expects __string__() on a Fraction to return a
"{num}:{den}" representation, which __repr__() no longer does.
  • Loading branch information
ferdnyc committed Jan 2, 2021
1 parent deae5b2 commit 1b82a3c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion bindings/python/openshot.i
Expand Up @@ -150,7 +150,12 @@
map1.insert({"den", $self->den});
return map1;
}
std::string __repr__() {
const std::string __string__() {
std::ostringstream result;
result << $self->num << ":" << $self->den;
return result.str();
}
const std::string __repr__() {
std::ostringstream result;
result << "Fraction(" << $self->num << ", " << $self->den << ")";
return result.str();
Expand Down

0 comments on commit 1b82a3c

Please sign in to comment.