[Python-ideas] Deprecating repr() and the like
random832 at fastmail.us
random832 at fastmail.us
Fri Aug 9 22:33:43 CEST 2013
On Fri, Aug 9, 2013, at 15:48, Serhiy Storchaka wrote:
> 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])
Is this a serious proposal, or a means of expressing displeasure with
another recent proposal? I have responses to each of those cases, but
need to know which one to post.
More information about the Python-ideas
mailing list