On Feb 16, 3:37 am, Neil Cerutti <[EMAIL PROTECTED]> wrote:
> On 2007-02-15, Steven D'Aprano <[EMAIL PROTECTED]> wrote:
>
> >> def multiAccept( argOfVariousTypes ):
> >> if isinstance(argOfVariousTypes,int):
> >> # treat like an int
> >> elif isinstance(argOfVariousTypes,float):
> >
Steven D'Aprano wrote:
> This is an example of overloading:
>
> class Cheese(object):
> def flavour(self):
> return "tasty and scrumptious"
> def colour(self):
> return "yellow"
>
> Now we define a sub-class which overloads some methods:
>
> class BlueVein(Cheese):
>
On 2007-02-15, Steven D'Aprano <[EMAIL PROTECTED]> wrote:
>> def multiAccept( argOfVariousTypes ):
>> if isinstance(argOfVariousTypes,int):
>> # treat like an int
>> elif isinstance(argOfVariousTypes,float):
>> # treat like a float
>> elif isinstance(argOfVariousTypes,(l
On 2007-02-15, placid <[EMAIL PROTECTED]> wrote:
>> > Is it possible to be able to do the following in Python?
>>
>> > class Test:
>> > def __init__(self):
>> > pass
>>
>> > def puts(self, str):
>> > print str
>>
>> > def puts(self, str,str2):
>> > print str,str
On 15 fév, 09:32, "Troy Melhase" <[EMAIL PROTECTED]> wrote:
> On 14 Feb 2007 20:54:31 -0800, placid <[EMAIL PROTECTED]> wrote:
>
> > class Test:
> > def __init__(self):
> > pass
>
> > def puts(self, str):
> > print str
>
> > def puts(self, str,str2):
> > print st
On 14 Feb 2007 20:54:31 -0800, placid <[EMAIL PROTECTED]> wrote:
> class Test:
> def __init__(self):
> pass
>
> def puts(self, str):
> print str
>
> def puts(self, str,str2):
> print str,str2
you might look into the overloading module and its decorator. source
On Feb 15, 12:23 am, Steven D'Aprano
<[EMAIL PROTECTED]> wrote:
> On Wed, 14 Feb 2007 21:58:35 -0800, Paul McGuire wrote:
> > No, Python does not do overloading as part of the language, you have
> > to do the variable argument interpretation for yourself.
>
> > For instance, if you want a method to
On Wed, 14 Feb 2007 21:58:35 -0800, Paul McGuire wrote:
> No, Python does not do overloading as part of the language, you have
> to do the variable argument interpretation for yourself.
>
> For instance, if you want a method to accept a single argument of
> various types, it would look something
On Wed, 14 Feb 2007 21:12:39 -0800, placid wrote:
> On Feb 15, 4:04 pm, Grant Edwards <[EMAIL PROTECTED]> wrote:
>> On 2007-02-15, placid <[EMAIL PROTECTED]> wrote:
>>
>>
>>
>> > Is it possible to be able to do the following in Python?
>>
>> > class Test:
>> > def __init__(self):
>> >
On Feb 14, 10:54 pm, "placid" <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> Is it possible to be able to do the following in Python?
>
> class Test:
> def __init__(self):
> pass
>
> def puts(self, str):
> print str
>
> def puts(self, str,str2):
> print str,str2
>
> if
On Feb 15, 4:04 pm, Grant Edwards <[EMAIL PROTECTED]> wrote:
> On 2007-02-15, placid <[EMAIL PROTECTED]> wrote:
>
>
>
> > Is it possible to be able to do the following in Python?
>
> > class Test:
> > def __init__(self):
> > pass
>
> > def puts(self, str):
> > print str
>
>
On 2007-02-15, placid <[EMAIL PROTECTED]> wrote:
> Is it possible to be able to do the following in Python?
>
> class Test:
> def __init__(self):
> pass
>
> def puts(self, str):
> print str
>
> def puts(self, str,str2):
> print str,str2
>
> if __name__ == "__mai
12 matches
Mail list logo