Closed treyhunner closed 9 years ago
I agree that your proposed API makes sense and looks clean.
Would you like to submit a PR with the necessary changes and a test case? If not, I'll look into it myself.
FYI SymPy supports expansion at infinity now:
In [45]: O(n, (n, oo)) * O(n**2, (n, oo)) + O(sqrt(n), (n, oo))
Out[45]:
⎛ 3 ⎞
O⎝n ; n → ∞⎠
@perimosocordiae I probably won't implement this myself. I won't have a need for bigO for a few weeks if I end up needing it.
You could implement this by implementing an __add__
and __mul__
method.
Done. Thanks for the suggestion, @treyhunner.
@asmeurer: Looks like that was added only a few months after I made this package, but I didn't know about it until now. Thanks for pointing it out! I'll add a note to the readme.