[Python-ideas] Deprecating repr() and the like
Michele Lacchia
michelelacchia at gmail.com
Fri Aug 9 22:40:10 CEST 2013
Isn't Python 5 too far away to think about it?
Il giorno 09/ago/2013 22:07, "Serhiy Storchaka" <storchaka at gmail.com> ha
scritto:
> repr(), ascii() and one-argument str() can be deprecated and removed in
> Python 5.0 because they are redundant and can be expressed as a simple
> formatting:
>
> repr(x) == '%r'%(x,) == '{!r}'.format(x)
> ascii(x) == '%a'%(x,) == '{!a}'.format(x)
> str(x) == '%s'%(x,) == '{}'.format(x)
>
> We also can deprecate string concatenation for the same reason:
>
> s1 + s2 == '%s%s'%(s1,s1) == '{}{}'.format(s1,s2) == ''.join([s1,s2])
>
> ______________________________**_________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/**mailman/listinfo/python-ideas<http://mail.python.org/mailman/listinfo/python-ideas>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130809/51edae2f/attachment.html>
More information about the Python-ideas
mailing list