Hi Steve (for clarity Turnbull)

You wrote: Allowing objects to decide implicitly how to represent
themselves is usually a bad idea, and we shouldn't encourage it.

I'm puzzled. I thought that when I define a class X, I'm generally
encouraged to define a __repr__ method, that is used to decide how an
instance of X represents itself.  (That is, unless I already get a good
__repr__ from inheritance.)

However, you wrote "decide implicitly". Perhaps I'm missing something in
the "implicitly".

For clarity, I'm not making a statement about your examples. Just the
principle which you claim underlies your examples.

best regards

Jonathan
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/UILZJNBS5YPG2KTKOFPOBQRHX7MA6OY6/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to