title: How to conditionally override a Python class property with a method
body: <p>Is it possible to conditionally override a class property with a property method?</p>
  
  <p>If I have this class which I can instantiate by passing in a dict:</p>
  
  <pre><code>def Foo(Object):
      def __init__(self, **kwargs):
          self.__dict__.update(kwargs)
  
      # pseudo code (this doesn't work)
      if not self.bar:
          @property
          def bar(self):
              return u"I have overridden foo's bar"
  </code></pre>
  
  <p>And I make this instance and set <code>bar</code> to <code>''</code> or <code>None</code>:</p>
  
  <pre><code>my_foo = Foo(**{'bar':u''})
  </code></pre>
  
  <p>and then I call the <code>bar</code> property:</p>
  
  <pre><code>my_foo.bar
  </code></pre>
  
  <p>and get</p>
  
  <pre><code>u"I have overridden foo's bar"
  </code></pre>
  
  <p>I would like to have the property method <code>bar</code> returned, instead of the <code>bar</code> value that was passed in when the object was created.</p>
  
  <p>Can I do that somehow?  Any help would be awesome.</p>