ho la seguente classe in Python__unicode __() non restituisce una stringa
class myTest:
def __init__(self, str):
self.str = str
def __unicode__(self):
return self.str
e in qualche altro file un myTest instantiate per provare il metodo unicode()
import myClass
c = myClass.myTest("hello world")
print c
come Stampare I get <myClass.myTest instance at 0x0235C8A0>
tuttavia se ho overrider __ str __() Otterrò hello world
come output. La mia domanda è, come dovrei scrivere il overrider per __ unicode __() se voglio che stringa di output invece?