summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2013-08-21 22:50:09 -0500
committerBenjamin Peterson <benjamin@python.org>2013-08-21 22:50:09 -0500
commitae116a5aae4caa0531478ce53078ac605dd93e66 (patch)
tree67ae4db16764b7c091df54c9e68aaffa20cc0205
parent5191f275204cb994330fb462b6d3f010dfe06130 (diff)
downloadsix-ae116a5aae4caa0531478ce53078ac605dd93e66.tar.gz
truncate add_metaclass docstring; narrative docs will be in the main documentation
-rw-r--r--six.py29
1 files changed, 1 insertions, 28 deletions
diff --git a/six.py b/six.py
index e91a37c..d5d37a3 100644
--- a/six.py
+++ b/six.py
@@ -425,34 +425,7 @@ def with_metaclass(meta, *bases):
return meta("NewBase", bases, {})
def add_metaclass(metaclass):
- """
- Decorate a class to replace it with a metaclass-constructed version.
-
- Usage:
-
- @add_metaclass(MyMeta)
- class MyClass(object):
- ...
-
- That code produces a class equivalent to
-
- class MyClass(object, metaclass=MyMeta):
- ...
-
- on Python 3 or
-
- class MyClass(object):
- __metaclass__ = MyMeta
-
- on Python 2
-
- Requires Python 2.6 or later (for class decoration). For use on Python
- 2.5 and earlier, use the legacy syntax:
-
- class MyClass(object):
- ...
- MyClass = add_metaclass(Meta)(MyClass)
- """
+ """Class decorator for creating a class with a metaclass."""
def wrapper(cls):
orig_vars = cls.__dict__.copy()
orig_vars.pop('__dict__', None)