title: How to write Strategy Pattern in Python differently than example in Wikipedia?
body: <p>In the 2009 Wikipedia entry for the Strategy Pattern, there's a example <a href="http://web.archive.org/web/20090626214649/http://en.wikipedia.org/wiki/Strategy_Pattern#PHP" rel="noreferrer">written in PHP</a>.</p>
  
  <p>Most other code samples do something like:</p>
  
  <pre><code>a = Context.new(StrategyA.new)
  a.execute #=&gt; Doing the task the normal way
  
  b = Context.new(StrategyB.new)
  b.execute #=&gt; Doing the task alternatively
  
  c = Context.new(StrategyC.new)
  c.execute #=&gt; Doing the task even more alternative
  </code></pre>
  
  <p>In the Python code a different technique is used with a Submit button. I wonder what the Python code will look like if it also did it the way the other code samples do.</p>
  
  <p><strong>Update:</strong> Can it be shorter using first-class functions in Python?</p>