Re: %r
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

Re: %r

From: Blackbird <fake@nospam.no>
Date: Tue Mar 07 2006 - 01:25:41 CET

Peter Hansen wrote:
> [...]>
> On the other hand, if 'something' is actually some arbitrary object,
> then it's definitely not always true, especially for anything not
> built in to Python.
>
> -Peter

Yes, I had strings in mind. And I guess it will work with the other
primitive types, but anything that repr to something like '<function f at
0x0128CFB0>' will crash, since it's not a valid Python expression.

Is the interpreter in fact using repr(), or parts of it, to generate output
when you type an expression at the command prompt? The results sure look
similar.

Blackbird
Received on Sun Apr 30 11:01:59 2006