using __init__ with params ( somewhat long )

Donn Cave donn at u.washington.edu
Wed Jan 17 13:48:16 EST 2001


Quoth rcameszREMOVETHIS at dds.removethistoo.nl (Robert Amesz):
| Corey wrote:
|> I'm new to Python ( from 5 odd years of Perl ), so
|> please bare with me...  
|          ^^^^
|
| Ehm... You *are* aware this is comp.lang.python and *not* a nudist
| colony, aren't you? 

Come on, this is the Internet, where no one knows you're naked.

As for the flesh of the subject, I have seen plenty of good ideas
in the followups about how one could implement the requirements,
with one exception - he seemed quite concerned about whether this
or that usage would be deemed appropriate and in accordance with
Python stylistic conventions.

I personally suspect trouble when I hear something like "how should
I, in this my first Python program, provide for accessor methods for
my class instance variables along with a back door for random case
user input."  I don't know how close we can get to conventional
Python usage from there, at any rate, so in case it helps I will
just point out that one of the more intractable dilemmas in Python
revolves around the __init__() function and inheritance.  While
I guess there is no consensus on how to handle it, I think it's
safe to say that the more stuff you can move to functions other
than __init__(), the easier it is to deal with what's left.

	Donn Cave, donn at u.washington.edu



More information about the Python-list mailing list