best way to get data into a new instance?
toby at tobiah.org
Thu Sep 28 17:15:13 CEST 2006
> So I'm wondering, is the best way to get all this information into the
> object to just have a really long __init__ method that takes each argument?
As was pointed out, you might ask that absolutely essential information
be passed to the constructor such as employee id#, but other then
that, I think that it is more usual to do:
self.id = id
e = Employee(32445)
e.firstname = 'foo'
e.lastname = 'bar'
... more as the information comes about.
Posted via a free Usenet account from http://www.teranews.com
More information about the Python-list