Skip to content

Conversation

@rhettinger
Copy link
Contributor

  • Have repr follow best practices and not hardwire the class name.
  • Convert comments to docstrings.
  • Enhance the demo with one non-dunder method, a dot product.

* __repr__ to follow best practices and not hardwire the class name.
* Convert comments to docstrings.
* Enhance the demo with one non-dunder method, a dot product.

def __add__(self, other):
# Element-wise addition
"Element-wise addition"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't best practise triple quotes for docstrings? Ref. PEP 8/documentation-strings

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're somewhat loose about this. The original rationale was that it would save you from retyping the quotes if the docstring grew to multiple lines. That isn't a likely possibility here.

@rhettinger rhettinger merged commit d69ae75 into python:master Mar 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip issue skip news

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants