Using __repr__ or __str__ for own printable class?

Donn Cave donn at u.washington.edu
Thu Apr 17 16:58:28 EDT 2003


Quoth Steven Taschuk <staschuk at telusplanet.net>:
| Quoth Tim Peters:
|> [...] What to do with each
|> method is in large part art, and the teachable seem to do OK learning by
|> example.  [...]
|
| I wonder, then, whether the docs would benefit from being
| augmented with a few examples.
|
| Donn -- would that improve their clarity in your view?

No, but if _replaced_ with a few examples, maybe.  I mean, if you
accept my contention that the documentation misrepresents the
actual usage of these functions, it's hard to remedy that with
an example.  Unless maybe hostile examples, like a repr that
spews out pages of state, but I assume that would not be the idea.

But then it's hard to describe their actual usage without examples,
so in the end, examples would certainly help, once the issues with
the text have been resolved.

	Donn Cave, donn at u.washington.edu




More information about the Python-list mailing list