diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2013-08-21 21:57:17 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2013-08-21 21:57:17 -0400 |
commit | 0d25e11477f96ff1d469a351f99240e4c715d378 (patch) | |
tree | ae0bb2403647980fe0b53e8f8ec9d9b93791d980 /six.py | |
parent | 07fee917e9ec2b8b076fdfec9d5afe8bd576d479 (diff) | |
download | six-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.py | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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() |