summaryrefslogtreecommitdiff
path: root/six.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2013-08-21 21:57:17 -0400
committerJason R. Coombs <jaraco@jaraco.com>2013-08-21 21:57:17 -0400
commit0d25e11477f96ff1d469a351f99240e4c715d378 (patch)
treeae0bb2403647980fe0b53e8f8ec9d9b93791d980 /six.py
parent07fee917e9ec2b8b076fdfec9d5afe8bd576d479 (diff)
downloadsix-0d25e11477f96ff1d469a351f99240e4c715d378.tar.gz
A better name was definitely needed. 'add_metaclass' instead of 'patch_with_metaclass'. It's more direct and succinct.
Diffstat (limited to 'six.py')
-rw-r--r--six.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/six.py b/six.py
index fc96d1e..39a9a92 100644
--- a/six.py
+++ b/six.py
@@ -422,13 +422,13 @@ def with_metaclass(meta, *bases):
"""Create a base class with a metaclass."""
return meta("NewBase", bases, {})
-def patch_with_metaclass(metaclass):
+def add_metaclass(metaclass):
"""
Decorate a class to replace it with a metaclass-constructed version.
Usage:
- @patch_with_metaclass(MyMeta)
+ @add_metaclass(MyMeta)
class MyClass(object):
...
@@ -449,7 +449,7 @@ def patch_with_metaclass(metaclass):
class MyClass(object):
...
- MyClass = patch_with_metaclass(MyClass)
+ MyClass = add_metaclass(MyClass)
"""
def wrapper(cls):
orig_vars = cls.__dict__.copy()