maybe this is a print odds

pipehappy pipehappy at gmail.com
Sun Nov 5 13:11:02 EST 2006


I come this code:

Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit
(Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> class He(object):
...     def __str__(self):
...         return "He"
...
>>> hes = [He(),He(),He()]
>>> print hes
[<__main__.He object at 0x00BE92D0>, <__main__.He object at
0x00BE9370>, <__main
__.He object at 0x00BE93B0>]       # I expect output: [He,He,He]
>>> print hes[0]
He
>>>

Do anyone know trick to overcome this or python has some proposal to
extend print that can do iterately print? I just want to get the way of
print which I my guess. Thanks a lot!




More information about the Python-list mailing list