Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

9
  • 2
    exactly. you could use operator.mul here as well Commented Jun 12, 2017 at 19:24
  • excellent thank you !! I now understand my mistake ... I need to wait 5 minutes before I can approve this as the answer ! Commented Jun 12, 2017 at 19:25
  • 1
    @acushner Thanks for the suggestion. I added it to the answer. Commented Jun 12, 2017 at 20:07
  • operator.mul won't actually be any faster; it's just defined and available for import from the standard library. Commented Jun 12, 2017 at 20:08
  • 1
    @MSeifert Thank you! I've been quite disappointed since I first looked at operator.py a few months ago, since I always thought it was exposing built-in functions. I never saw the import _operator at the bottom, expecting to have seen it near the top instead. (Having it at the bottom makes sense, now that I give it a moment's thought.) Commented Jun 12, 2017 at 20:22