Undefined Class

Inheritance diagram of Undefined

class Undefined(hint=None, obj=missing, name=None, exc=<class 'jinja2.exceptions.UndefinedError'>)

The default undefined type. This undefined type can be printed and iterated over, but every other access will raise an UndefinedError:

>>> foo = Undefined(name='foo')
>>> str(foo)
''
>>> not foo
True
>>> foo + 42
Traceback (most recent call last):
  ...
UndefinedError: 'foo' is undefined

Methods

__init__([hint, obj, name, exc])

Descriptions

class Undefined

Method details

__init__(hint=None, obj=missing, name=None, exc=<class 'jinja2.exceptions.UndefinedError'>)

Table Of Contents

Previous topic

TemplateReference Class

Next topic

TemplateNotFound