Re: code explanation

2013-01-14 Thread Ian Kelly
On Mon, Jan 14, 2013 at 9:51 PM, Rodrick Brown wrote: > import sys > > PY3K = sys.version_info >= (3,) > > > methods = set([ > "__iter__", > "__len__", > "__contains__", > > "__lt__", > "__le__", > "__eq__", > "__ne__", > "__gt__", > "__ge__", > > "__add__",

Re: code explanation

2013-01-14 Thread Rodrick Brown
On Mon, Jan 14, 2013 at 11:38 PM, Steven D'Aprano < steve+comp.lang.pyt...@pearwood.info> wrote: > On Mon, 14 Jan 2013 23:00:16 -0500, Rodrick Brown wrote: > > > Can someone explain what's going on here. > > > > def _build_magic_dispatcher(method): > > def inner(self, *args, **kwargs): > >

Re: code explanation

2013-01-14 Thread Terry Reedy
On 1/14/2013 11:00 PM, Rodrick Brown wrote: Can someone explain what's going on here. def _build_magic_dispatcher(method): def inner(self, *args, **kwargs): return self.__dict__[method](*args, **kwargs) inner.__name__ = method return inner Nothing, until you run that wi

Re: code explanation

2013-01-14 Thread Steven D'Aprano
On Mon, 14 Jan 2013 23:00:16 -0500, Rodrick Brown wrote: > Can someone explain what's going on here. > > def _build_magic_dispatcher(method): > def inner(self, *args, **kwargs): > return self.__dict__[method](*args, **kwargs) > inner.__name__ = method > return inner > > Thank

code explanation

2013-01-14 Thread Rodrick Brown
Can someone explain what's going on here. def _build_magic_dispatcher(method): def inner(self, *args, **kwargs): return self.__dict__[method](*args, **kwargs) inner.__name__ = method return inner Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Code Explanation

2007-05-17 Thread Michael Bentley
On May 17, 2007, at 4:12 AM, Robert Rawlins - Think Blue wrote: I’m currently working on a non-python project, and I’m trying to overcome a task of parsing a text file into a database and/or xml file. I’ve managed to find a parser example written in python, and I’m hoping to deconstruct the

Re: Code Explanation

2007-05-17 Thread rishi pathak
On 5/17/07, Robert Rawlins - Think Blue <[EMAIL PROTECTED]> wrote: Hello Guys, I'm currently working on a non-python project, and I'm trying to overcome a task of parsing a text file into a database and/or xml file. I've managed to find a parser example written in python, and I'm hoping to d

Code Explanation

2007-05-17 Thread Robert Rawlins - Think Blue
Hello Guys, I'm currently working on a non-python project, and I'm trying to overcome a task of parsing a text file into a database and/or xml file. I've managed to find a parser example written in python, and I'm hoping to deconstruct the code methodology a bit so I can write it in another lan