>>> class Item():
... def __init__(self):
... self.code = ''
... self.data = ''
... def __str__(self):
... """ support a nice string representation with all attribute values"""
... return 'caonimabi'
... def __repr__(self):
... return 'caonimaligebi'
...
>>> a=Item()
>>> a
caonimaligebi
>>> print a
caonimabi
请忽视拼音含义,因为team里有个sb装逼,对他说的