ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> python-list
python-list
Re: repr of type and class objects
by Donn Cave other posts by this author
Jan 25 2003 4:15PM messages near this date
Re: Printing repeatedly on same line | Re: help on autosuper
Quoth Erik Max Francis <max@[...].com> :
...
| I think you're reading too much into the "philosophy behind repr."  It
| is simply not the case that eval(repr(x)) == x should be true for all x,
| or even all builtin x types.  Even the interpreter help for repr simply
| says "for most object types."

Which has to be an exaggeration, though "for most objects" might
be true.

If repr is really used as a marshalling function, then the people
who are using it ought to be asking for something that can work
more reliably, a dedicated function that doesn't have to produce
something also intended for human eyes.  This function can fall
back on __repr__ the way str does.

If it really isn't seriously needed as a marshalling function, then
that notion ought to be forgotten, and some of the attendant issues
can be resolved (seems to me there was an issue with floating point
precision, for example.)

	Donn Cave, donn@[...].com
-- 
http://mail.python.org/mailman/listinfo/python-list

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved