String adding.
Jon Ribbens
jon+python-list at unequivocal.co.uk
Wed Oct 18 06:03:11 EDT 2000
Alex Martelli <aleaxit at yahoo.com> wrote:
> > BTW `x` is the same as repr(x)
>
> Exactly because of this, I would suggest
> "<%s>" % whatever
> as a preferable solution to
> '<' + `whatever` + '>'
Yes, this is one of the things that confuses me in Python. I can't see
repr ever being used in real programs. Why is there a syntactic shortcut
for it? Surely 'str' is almost always what you actually want?
Cheers
Jon
More information about the Python-list
mailing list