Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 756e8ce11d
Fetching contributors…

Cannot retrieve contributors at this time

10 lines (9 sloc) 0.355 kb
def monkeypatch_class(name, bases, namespace):
# Source:
# http://mail.python.org/pipermail/python-dev/2008-January/076194.html
assert len(bases) == 1, "Exactly one base class required"
base = bases[0]
for name, value in namespace.iteritems():
if name != "__metaclass__":
setattr(base, name, value)
return base
Jump to Line
Something went wrong with that request. Please try again.