'self' an unknown variable???

Giorgi Lekishvili gleki at gol.ge
Mon Jan 14 19:40:22 CET 2002


Hello all!

I have written a class, with the function write. The latter is defined
as follows:

def write(self, filename, matr, cols=self.Npred, format='asc'):
    blablabla
    return res

This doesn't work. Then I changed cols=N, previously defined
N=self.Npred.
Now things ar ok.

Why doesn't function self.some_attr in the function declaration?

Grtz,
Giorgi




More information about the Python-list mailing list