def monkeypatch_property(cls):
 def decorator(func):
  setattr(cls, func.__name__, property(func))
  return func
 return decorator

def monkeypatch_property ( cls ) : def decorator ( func ) : setattr ( cls , func . __name__ , property ( func ) ) return func return decorator
a decorator to add a single method as a property to an existing class:: @monkeypatch_property def <newmethod>: pass .