[Tutor] Please explain part of this code

Jerry Hill malaclypse2 at gmail.com
Mon Feb 20 17:06:26 EST 2017


On Wed, Feb 15, 2017 at 5:37 PM, Jim <jf_byrnes at comcast.net> wrote:
> I don't recall ever seeing this before.  What is this technique called?

I've heard picking which function to call sometimes called
"dispatching", and picking which function to call based on functions
held in a dictionary called "dictionary dispatch", or "dictionary
based dispatching".  I think this is in contrast to a C technique
called "table dispatching".  A google search for the phrase "python
dictionary dispatch" should get lots of hits talking about the
technique (I had to include "python" otherwise google kept trying to
give me the dictionary definition of the word dispatch).

Jerry


More information about the Tutor mailing list