best way to get data into a new instance?

John Machin sjmachin at lexicon.net
Thu Sep 28 19:32:38 EDT 2006


Diez B. Roggisch wrote:

>
> The programmer is responsible for the construction of new instances (or
> at least the code which will do that), and a constructor should contain
> parameters for at least the values you absolutely expect to be there -
> for example name and age or something like that in your example.

Age? Absolutely expect?? Call me crazy, but I'd record the primary
information (date of birth), *if* available, and derive age on the fly
if possible if and only if needed.




More information about the Python-list mailing list