Context
faststream._internal.context.context_type.Context
#
Bases: CustomField
A class to represent a context.
| ATTRIBUTE | DESCRIPTION |
|---|---|
param_name |
name of the parameter
|
| METHOD | DESCRIPTION |
|---|---|
__init__ |
constructor method |
use |
method to use the context |
Initialize the object.
| PARAMETER | DESCRIPTION |
|---|---|
real_name
|
The real name of the object.
TYPE:
|
default
|
The default value of the object.
TYPE:
|
initial
|
The initial value builder.
TYPE:
|
cast
|
Whether to cast the object.
TYPE:
|
prefix
|
The prefix to be added to the name of the object.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
TypeError
|
If the default value is not provided. |
Source code in faststream/_internal/context/context_type.py
use
#
Use the given keyword arguments.
| PARAMETER | DESCRIPTION |
|---|---|
**kwargs
|
Keyword arguments to be used
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
dict[str, Any]
|
A dictionary containing the updated keyword arguments |