[Python-Dev] At the interactive port
Fred L. Drake, Jr.
Mon, 1 May 2000 10:04:08 -0400 (EDT)
Moshe Zadka writes:
> 1. I'm not sure what to call this function. Currently, I call it
> __print_expr__, but I'm not sure it's a good name
It's not. ;) How about printresult?
Another thing to think about is interface; formatting a result and
"printing" it may be different, and you may want to overload them
separately in an environment like IDLE. Some people may want to just
sys.formatresult = str
I'm inclined to think that level of control may be better left to
the application; if one hook is provided as you've described, the
application can build different layers as appropriate.
> 2. I haven't yet supplied a default in __builtin__, so the user *must*
> override this. This is unacceptable, of course.
You're right! But a default is easy enough to add. I'd put it in
sys instead of __builtin__ though.
Fred L. Drake, Jr. <fdrake at acm.org>
Corporation for National Research Initiatives