Re: code explanation

Discussion in 'Python' started by Terry Reedy, Jan 15, 2013.

  1. Terry Reedy

    Terry Reedy Guest

    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 with some particular version of Python. If
    you do run it, the result should be as documented for that particular
    version. If you write additional code to call the function, the result
    will depend on the Python version and argument.

    Now, what did you actually want to know ;-?
    You should likely find the answer in the reference manual, especially
    the section on def statements.

    --
    Terry Jan Reedy
     
    Terry Reedy, Jan 15, 2013
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. uthra
    Replies:
    1
    Views:
    420
    John Gordon
    Nov 10, 2006
  2. responsible
    Replies:
    4
    Views:
    353
    red floyd
    Aug 5, 2008
  3. Neville Franks

    Code explanation requeted

    Neville Franks, Feb 5, 2007, in forum: Ruby
    Replies:
    4
    Views:
    116
    Marcello Barnaba
    Feb 6, 2007
  4. Michael Albers

    Explanation on some code

    Michael Albers, Dec 1, 2008, in forum: Ruby
    Replies:
    5
    Views:
    123
    Robert Dober
    Dec 1, 2008
  5. Phil Thompson

    Explanation of code needed

    Phil Thompson, Mar 21, 2005, in forum: Javascript
    Replies:
    4
    Views:
    170
    Phil Thompson
    Mar 22, 2005
Loading...

Share This Page