Closed blablatdinov closed 1 year ago
Hi @blablatdinov, thanks for the message. I'm not sure operator.mul
will actually simplify that expression, how do you plan to use it? Can you attach an example here? Thanks!
Yes, it will look something like this:
import operator
from functools import reduce
class SimpleCalculator:
[...]
def mul(self, *args):
return reduce(operator.mul, args)
Oh, I see what you mean now. Sorry, for some reason I thought you wanted to replace reduce
... Don't mind me.
Thanks, good suggestion. No need to send a PR, I will add it to the post. I will leave this open until I fixed it.
Thanks!
Hi @blablatdinov! I fixed this in the post and in the code you find on GitHub. Thanks for the suggestion and apologies for the long delay!
Hello, I read your article about TDD and found a place where the
operator.mul
function looks more appropriate. I want to create a PR if the author agree with this opinionhttps://github.com/TheDigitalCatOnline/blog_source/blob/9f28de64f127f0f765c0d6e53fb751e5f987697a/pelican/content/tdd-in-python-with-pytest-part-1.mau#L810