[Python-3000] PEP 3138- String representation in Python 3000

Greg Ewing greg.ewing at canterbury.ac.nz
Tue May 27 04:04:51 CEST 2008


Jim Jewett wrote:

> I certainly support a flag for repr meaning "This was really str; repr
> got called because the container doesn't have str, but go back to str
> for the contents."

Doing this properly would require changing the signature
of repr() *everywhere*, not just for strings, because
the flag needs to be propagated recursively to any nested
object that could have strings in it.

> Alternatively, write an explicit repr that does
> that,

Again, every container type would need to know about and handle
this new form of repr().

-- 
Greg


More information about the Python-3000 mailing list