|
|
None | __init__ (self, t.Optional[str] hint=None, t.Any obj=missing, t.Optional[str] name=None, t.Type[TemplateRuntimeError] exc=UndefinedError) |
| |
|
t.Any | __getattr__ (self, str name) |
| |
|
bool | __eq__ (self, t.Any other) |
| |
|
bool | __ne__ (self, t.Any other) |
| |
|
int | __hash__ (self) |
| |
|
str | __str__ (self) |
| |
|
int | __len__ (self) |
| |
|
t.Iterator[t.Any] | __iter__ (self) |
| |
|
t.AsyncIterator[t.Any] | __aiter__ (self) |
| |
|
bool | __bool__ (self) |
| |
|
str | __repr__ (self) |
| |
| str | _undefined_message (self) |
| |
| "te.NoReturn" | _fail_with_undefined_error (self, *t.Any args, **t.Any kwargs) |
| |
|
| _undefined_hint |
| |
|
| _undefined_obj |
| |
|
| _undefined_name |
| |
|
| _undefined_exception |
| |
|
| _undefined_message |
| |
An undefined that barks on print and iteration as well as boolean
tests and all kinds of comparisons. In other words: you can do nothing
with it except checking if it's defined using the `defined` test.
>>> foo = StrictUndefined(name='foo')
>>> str(foo)
Traceback (most recent call last):
...
jinja2.exceptions.UndefinedError: 'foo' is undefined
>>> not foo
Traceback (most recent call last):
...
jinja2.exceptions.UndefinedError: 'foo' is undefined
>>> foo + 42
Traceback (most recent call last):
...
jinja2.exceptions.UndefinedError: 'foo' is undefined