Classes
QueryParams
10
▼
Immutable query string parameters.
``__getitem__`` returns the first value for a key.
``get_list``…
QueryParams
10
▼
Immutable query string parameters.
__getitem__returns the first value for a key.
get_listreturns all values for a key.
Methods
get
2
str | None
▼
Return the first value for *key*, or *default* if missing.
get
2
str | None
▼
def get(self, key: str, default: str | None = None) -> str | None
Parameters
| Name | Type | Description |
|---|---|---|
key |
— |
|
default |
— |
Default:None
|
Returns
str | None
get_list
1
list[str]
▼
Return all values for *key*.
get_list
1
list[str]
▼
def get_list(self, key: str) -> list[str]
Parameters
| Name | Type | Description |
|---|---|---|
key |
— |
Returns
list[str]
get_int
2
int | None
▼
Return value as int, or *default* if missing or not numeric.
get_int
2
int | None
▼
def get_int(self, key: str, default: int | None = None) -> int | None
Parameters
| Name | Type | Description |
|---|---|---|
key |
— |
|
default |
— |
Default:None
|
Returns
int | None
get_bool
2
bool | None
▼
Return value as bool (``true``/``1``/``yes``/``on`` → True).
get_bool
2
bool | None
▼
def get_bool(self, key: str, default: bool | None = None) -> bool | None
Parameters
| Name | Type | Description |
|---|---|---|
key |
— |
|
default |
— |
Default:None
|
Returns
bool | None
Internal Methods 6 ▼
__init__
1
▼
__init__
1
▼
def __init__(self, query_string: bytes = b'') -> None
Parameters
| Name | Type | Description |
|---|---|---|
query_string |
— |
Default:b''
|
__getitem__
1
str
▼
__getitem__
1
str
▼
def __getitem__(self, key: str) -> str
Parameters
| Name | Type | Description |
|---|---|---|
key |
— |
Returns
str
__contains__
1
bool
▼
__contains__
1
bool
▼
def __contains__(self, key: object) -> bool
Parameters
| Name | Type | Description |
|---|---|---|
key |
— |
Returns
bool
__iter__
0
Iterator[str]
▼
__iter__
0
Iterator[str]
▼
def __iter__(self) -> Iterator[str]
Returns
Iterator[str]
__len__
0
int
▼
__len__
0
int
▼
def __len__(self) -> int
Returns
int
__repr__
0
str
▼
__repr__
0
str
▼
def __repr__(self) -> str
Returns
str