Re: [Tutor] "Overloading" methods

2010-09-17 Thread Lie Ryan
On 09/17/10 00:22, Vince Spicer wrote: > > > Well I can't comment on right or wrong I would think creating a simple > class with a __call__ method is a little more pythonic. I think even more pythonic is to use closure: def create_setpattern(type_): def f(self, pattern, parameter):

Re: [Tutor] "Overloading" methods

2010-09-16 Thread Steven D'Aprano
On Thu, 16 Sep 2010 10:02:18 pm Michael Powe wrote: > Hello, > > Strictly speaking, this isn't overloading a method in the way we do > it in Java. But similar. Maybe. Ha ha, you sound like me -- I can recognise design patterns, but I have no idea what they're called, or why anyone bothers to di

Re: [Tutor] "Overloading" methods

2010-09-16 Thread Alan Gauld
On Thu, Sep 16, 2010 at 6:02 AM, Michael Powe wrote: line structures, I had the thought to write methods with descriptive names that simply returned a generic method that processed the method arguments. e.g., def setpattern_iis(self,pattern,parameter) : type='iis' return pat

Re: [Tutor] "Overloading" methods

2010-09-16 Thread Vince Spicer
On Thu, Sep 16, 2010 at 6:02 AM, Michael Powe wrote: > Hello, > > Strictly speaking, this isn't overloading a method in the way we do it > in Java. But similar. Maybe. > > I am writing a module for processing web server log files and one of > the methods I provide is to extract a given query pa

[Tutor] "Overloading" methods

2010-09-16 Thread Michael Powe
Hello, Strictly speaking, this isn't overloading a method in the way we do it in Java. But similar. Maybe. I am writing a module for processing web server log files and one of the methods I provide is to extract a given query parameter and its value. Because there are several types of log files