A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2000-April/003357.html below:

[Python-Dev] Improving readability of interpreter expression output (was The purpose of 'repr'...)

[Python-Dev] Improving readability of interpreter expression output (was The purpose of 'repr'...)Peter Funk pf@artcom-gmbh.de
Wed, 12 Apr 2000 10:11:23 +0200 (MEST)
Hi!

Tim Peters:
[...]
> This is a different issue than (but related to) what the interactive prompt
> should use by default to format expression results.  They have one key
> conundrum in common, though:  if str() is simply passed down with no other
> change, then e.g.
> 
>     print str({"a:": "b, c", "a, b": "c"})
> and (same thing in disguise)
>     print {"a:": "b, c", "a, b": "c"}
> 
> would display
> 
>     {a:: b, c, a, b: c}
> 
> and that's darned unreadable.  

Would you please elaborate a bit more, what you have in mind with
"other change" in your sentence above?

> As far as I can tell, the only reason
> str(container) invokes repr on the containees today is simply to get some
> string quotes in output like this.  That's fine so far as it goes, but leads
> to miserably bloated displays for containees of many types *other* than the
> builtin ones -- and even for string containees leads to embedded octal
> escape sequences all over the place.
> 
> > I don't know how to fix this, though. :-(
> 
> Sure you do!  And we look forward to your patch <wink>.

No.  Serious.  I don't see how to fix the 'darned unreadable' output.
passing 'str' down seems to be simple.  But how to fix the problem
above isn't obvious to me.

Regards, Peter



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4