assign class variable in __init__

Ross Williamson rosswilliamson.spt at gmail.com
Tue Jun 8 12:04:25 EDT 2010


Hi Everyone,

Just a quick question - Is it possible to assign class variables in
the __init__() - i.e. somthing like:

def __init__(self,self.source = "test", self.length = 1)

rather than

def __init__(self,source = "test", length = 1):


-- 
Ross Williamson
University of Chicago
Department of Astronomy & Astrophysics
773-834-9785 (office)
312-504-3051 (Cell)



More information about the Python-list mailing list