Browse files

Give Undefined an ABCMeta metaclass, which allows reimplementations o…

…f Undefined to appear to inherit from Undefined, while not actually subclassing it. This removes the restrictions that including a __slots__ member introduces.
  • Loading branch information...
1 parent 7d268be commit 614c416359f169f92e02db131a6a22473d4af45f @cwillu committed Oct 11, 2011
Showing with 2 additions and 0 deletions.
  1. +2 −0 jinja2/
2 jinja2/
@@ -9,6 +9,7 @@
:license: BSD.
from itertools import chain, imap
+from abc import ABCMeta
from jinja2.nodes import EvalContext, _context_function_types
from jinja2.utils import Markup, partial, soft_unicode, escape, missing, \
concat, internalcode, next, object_type_repr
@@ -412,6 +413,7 @@ def __repr__(self):
class Undefined(object):
+ __metaclass__ = ABCMeta
"""The default undefined type. This undefined type can be printed and
iterated over, but every other access will raise an :exc:`UndefinedError`:

0 comments on commit 614c416

Please sign in to comment.