Re: Callable or not callable, that is the question!

2013-07-12 Thread Peter Otten
Steven D'Aprano wrote: > On Fri, 12 Jul 2013 07:36:30 +, Duncan Booth wrote: > >> To be a convincing use-case you would have to show a situation where >> something had to be both a static method and a utility method rather >> than just one or the other and also where you couldn't just have bo

Re: Callable or not callable, that is the question!

2013-07-12 Thread Steven D'Aprano
On Fri, 12 Jul 2013 07:36:30 +, Duncan Booth wrote: > To be a convincing use-case you would have to show a situation where > something had to be both a static method and a utility method rather > than just one or the other and also where you couldn't just have both. I have a class where I hav

Re: Callable or not callable, that is the question!

2013-07-12 Thread Duncan Booth
Ulrich Eckhardt wrote: > Am 11.07.2013 16:11, schrieb Peter Otten: >> Ulrich Eckhardt wrote: >>> Bug or feature? >> >> No bug. Missing feature if you come up with a convincing use-case. > > class Parser: > def _handle_bool(input): > # ... > pass > > types = {'bool':

Re: Callable or not callable, that is the question!

2013-07-12 Thread Ulrich Eckhardt
Am 11.07.2013 16:11, schrieb Peter Otten: Ulrich Eckhardt wrote: Bug or feature? No bug. Missing feature if you come up with a convincing use-case. class Parser: def _handle_bool(input): # ... pass types = {'bool': _handle_bool, 'boolean': _handle_bool,}

Re: Callable or not callable, that is the question!

2013-07-12 Thread Ian Kelly
On Thu, Jul 11, 2013 at 8:12 PM, Steven D'Aprano wrote: > On Thu, 11 Jul 2013 15:05:59 +0200, Ulrich Eckhardt wrote: > >> Hello! >> >> I just stumbled over a case where Python (2.7 and 3.3 on MS Windows) >> fail to detect that an object is a function, using the callable() >> builtin function. Inve

Re: Callable or not callable, that is the question!

2013-07-11 Thread Steven D'Aprano
On Thu, 11 Jul 2013 15:05:59 +0200, Ulrich Eckhardt wrote: > Hello! > > I just stumbled over a case where Python (2.7 and 3.3 on MS Windows) > fail to detect that an object is a function, using the callable() > builtin function. Investigating, I found out that the object was indeed > not callable

Re: Callable or not callable, that is the question!

2013-07-11 Thread Jason Swails
On Thu, Jul 11, 2013 at 9:05 AM, Ulrich Eckhardt < ulrich.eckha...@dominolaser.com> wrote: > Hello! > > I just stumbled over a case where Python (2.7 and 3.3 on MS Windows) fail > to detect that an object is a function, using the callable() builtin > function. Investigating, I found out that the o

Re: Callable or not callable, that is the question!

2013-07-11 Thread Peter Otten
Ulrich Eckhardt wrote: > Hello! > > I just stumbled over a case where Python (2.7 and 3.3 on MS Windows) > fail to detect that an object is a function, using the callable() > builtin function. Investigating, I found out that the object was indeed > not callable, but in a way that was very unexpec