On 20 maj 2013, at 03:46, Guido van Rossum <gu...@python.org> wrote:

> On Sun, May 19, 2013 at 4:27 PM, Gregory P. Smith <g...@krypto.org> wrote:
>> Now you've got me wondering what Python would be like if repr, `` and
>> __repr__ never existed as language features. Upon first thoughts, I actually
>> don't see much downside (no, i'm not advocating making that change).
>> Something to ponder.
> 
> I have pondered it many times, although usually in the form "Why do we
> need both str and repr?"


What if we did the opposite?

1. Make __str__() a protocol for arbitrary string conversion.
2. Move the current __repr__() contracts, both firm and informal to a new, 
extensible version of pprint.

There has been some discussion led by Raymond in 2010 about a general `pprint 
rewrite`__ and I'm willing to pick up the idea with a PEP for inclusion in 3.4.



__ http://bugs.python.org/issue7434

-- 
Best regards,
Łukasz Langa

WWW: http://lukasz.langa.pl/
Twitter: @llanga
IRC: ambv on #python-dev

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to