[Tutor] Concatenation
Alan Gauld
alan.gauld at yahoo.co.uk
Sat Aug 20 17:45:37 EDT 2022
On 20/08/2022 01:09, dn wrote:
> On 20/08/2022 10.40, avi.e.gross at gmail.com wrote:
> Yet __repr__() is there! Many other standard type-conversions are
..
> Wonder why, when Python 3 (-ish) took strings from ASCII-bytes to UTF-8,
> no string equivalents were (formally) added?
Isn't it the case that str() calls __strt__() if it exists and
if not it calls __repr__()?
Thus, where only a simple representation is needed, implementing
__repr__() alone is probably adequate.
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos
More information about the Tutor
mailing list