> OK, but that was just your example :-) Here is some ugly quick code
> which might show you how to meet you needs:
>
> class JohnsMultiInitClass:
> def __init__(self, first, second):
> if type(first) == type(second) == str:
> self.string_init(first, second)
> i
Gooch, John said unto the world upon 2005-04-19 10:20:
Brian,
I think in the OO world it is called Polymorphism, where you have a single
function name, but multiple definitions that are distinguished from one
another by the number of arguments, type of arguments, and sometimes (
Smalltalk ) the r
> I think in the OO world it is called Polymorphism,
Nope, its called overloading. Polymorphism is where you
send the same message to diferent types of object and
get different behaviour.
> where you have a single function name, but multiple definitions
> that are distinguished from one another b
L.L.C.
9601 S. Meridian Blvd.
Englewood, CO 80112
Desk: 720-514-5708
-Original Message-
From: Brian van den Broek [mailto:[EMAIL PROTECTED]
Sent: Friday, April 15, 2005 4:22 PM
To: Gooch, John
Cc: Python tutor
Subject: Re: [Tutor] Contructor Overloading and Function Tooktips
On Fri, 15 Apr 2005, Gooch, John wrote:
> Is there a way to create multiple __init__ routines in a Python Class?
Hi John,
In general, Python doesn't support "overloading". Overloading wouldn't
interact well at all with functions that can take a variable number of
arguments.
That being said,
Gooch, John said unto the world upon 2005-04-15 18:03:
I have a couple of questions:
Is there a way to create multiple __init__ routines in a Python Class?
Hi John,
I'm not sure what you mean by that. Could be me, or could be the
question. :-)
Secondly, I cannot remember how to make it so that w
Gooch, John wrote:
> Is there a way to create multiple __init__ routines in a Python Class?
Not directly (well, not that I know of). But you can always emulate it.
eg:
class Foo(object):
def __init__(self, init, *args, **kw):
if init == 'this':
self._initThis(*args, **kw)
elif ini
I have a couple of questions:
Is there a way to create multiple __init__ routines in a Python Class?
Secondly, I cannot remember how to make it so that when you start typing in
a defined function name, it pops up a tooltip showing the functions syntax.
ex: def delRecord( some params ):