title: How to use lambda as method within a class?
body: <p>Here is what I am trying to do</p>
  
  <pre><code>class BaseClass(object):
      successify = lambda x: "&lt;Success&gt;%s&lt;/Success&gt;" % x
      errorify = lambda x: "&lt;Error&gt;%s&lt;/Error&gt;" % x
      def try1(self):
          print successify("try1")
      def try2(self):
          print self.successify("try2")
  </code></pre>
  
  <p>But neither of the methods seem to work..</p>
  
  <pre><code>&gt;&gt;&gt; BaseClass().try1()
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "&lt;stdin&gt;", line 5, in try1
  NameError: global name 'successify' is not defined
  &gt;&gt;&gt; BaseClass().try2()
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "&lt;stdin&gt;", line 7, in try2
  TypeError: &lt;lambda&gt;() takes exactly 1 argument (2 given)
  </code></pre>
  
  <p>How do I use lambdas as methods within a class?</p>