Paul Prescod wrote:
> As a convenience, if the show function is passed a> single object to show, it returns that object. If> it is passed more then one, it returns them as a> tuple. This can be very convenient in debugging> contexts.
That would lead to a problem with the interactive shell, though. For
instance, this would happen:
I'm sure there would be some way around that, but it might add more
oddities to the language than print does.
In any case, I did a quick Python implementation of the show function.
All bugs are features. :-)
def show(*objects, **parameters):
seperator = parameters.get('seperator', ' ')
trailer = parameters.get('trailer', '\n')
to = parameters.get('to', sys.stdout)
first = 1
for object in objects:
if not first:
first = 0
if len(objects) == 1: