2015-10-27 11:47 GMT+01:00 Perini Matteo <perini.mat...@gmail.com>: > Il 26/10/2015 21:31, Manlio Perillo ha scritto: >> > [...] > class CC(): > def __init__(self): > self.a = 2 > self.b = 4 > self.c = 5 > def menouno(self,x): > return x-1 > def somma(self): > return self.menouno(self.a+self.b+self.c) > > [...] > > from pt import CC > > def test_somma(): > CC.__init__(CC) > assert CC.somma(CC)==10 >
Ti ho detto che non devi usare la classe in questo modo! https://docs.python.org/2/tutorial La classe la devi *instanziare*. Ciao Manlio _______________________________________________ Python mailing list Python@lists.python.it http://lists.python.it/mailman/listinfo/python