Classes
DefParam
2
▼
A single parameter in a {% def %} with optional type annotation.
DefParam
2
▼
A single parameter in a {% def %} with optional type annotation.
Attributes
| Name | Type | Description |
|---|---|---|
name |
str
|
— |
annotation |
str | None
|
— |
Def
7
▼
Function definition: {% def name(params) %}...{% end %}
Def
7
▼
Function definition: {% def name(params) %}...{% end %}
Attributes
| Name | Type | Description |
|---|---|---|
name |
str
|
— |
params |
Sequence[DefParam]
|
— |
body |
Sequence[Node]
|
— |
defaults |
Sequence[Expr]
|
— |
vararg |
str | None
|
— |
kwarg |
str | None
|
— |
Methods
args
0
tuple[str, ...]
▼
Backward-compat bridge: returns parameter names.
property
args
0
tuple[str, ...]
▼
def args(self) -> tuple[str, ...]
Returns
tuple[str, ...]
Slot
1
▼
Slot placeholder inside {% def %}: {% slot %} or {% slot name %}
Slot
1
▼
Slot placeholder inside {% def %}: {% slot %} or {% slot name %}
Attributes
| Name | Type | Description |
|---|---|---|
name |
str
|
— |
SlotBlock
2
▼
Named slot content inside {% call %}: {% slot name %}...{% end %}
SlotBlock
2
▼
Named slot content inside {% call %}: {% slot name %}...{% end %}
Attributes
| Name | Type | Description |
|---|---|---|
name |
str
|
— |
body |
Sequence[Node]
|
— |
CallBlock
4
▼
Call function with slot content: {% call name(args) %}...{% end %}
CallBlock
4
▼
Call function with slot content: {% call name(args) %}...{% end %}
Attributes
| Name | Type | Description |
|---|---|---|
call |
Expr
|
— |
slots |
dict[str, Sequence[Node]]
|
— |
args |
Sequence[Expr]
|
— |
Methods
body
0
Sequence[Node]
▼
Backward-compat: default slot content.
property
body
0
Sequence[Node]
▼
def body(self) -> Sequence[Node]
Returns
Sequence[Node]