[Python-3000] Types and classes

Guido van Rossum guido at python.org
Wed Apr 9 18:20:56 CEST 2008


On Wed, Apr 9, 2008 at 8:47 AM, Neil Schemenauer <nas at arctrix.com> wrote:
> Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
>  > There's something reassuring about the fact that things
>  > with no "obvious" textual representation stick out like
>  > a sore digit when you try to print them. I wouldn't like
>  > to lose that.
>
>  I agree with this and support the status quo (i.e. repr(int) ==
>  str(int) == "<type 'int'>").  I think str(int) == 'int' could lead
>  to confusion if you have a bug in your program.

So could str(3) == str('3'). I don't see why printing a type is
considered something so unusual that it ought to look weird. We
already have repr() if you want unambiguous output; str() is for
pretty output.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-3000 mailing list