3

What is the docstring convention in Python for the following "magic" class methods:

  • __str__
  • __unicode__
  • __repr__

Should I add docstrings for these? If yes, what should they say (for each)?

asked Nov 23, 2015 at 20:27
1
  • 1
    Sharing your research helps everyone. Tell us what you've tried and why it didn’t meet your needs. This demonstrates that you’ve taken the time to try to help yourself, it saves us from reiterating obvious answers, and most of all it helps you get a more specific and relevant answer. Also see How to Ask Commented Nov 24, 2015 at 4:42

1 Answer 1

3

I wouldn't add docstrings; they'll never meaningfully differ from the python stdlib docs relating to them.

answered Nov 23, 2015 at 20:45

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.