Classes
MultiValueMapping
6
▼
A read-only string mapping where keys can have multiple values.
``__getitem__`` returns the first …
MultiValueMapping
6
▼
A read-only string mapping where keys can have multiple values.
__getitem__returns the first value for a key.
get_listreturns all values for a key.
Structurally compatible withMapping[str, str] plus get_list.
Defined with explicit dunder methods because Python 3.14 Protocols
cannot inherit from non-Protocol ABCs likeMapping.
Methods
get
2
str | None
▼
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]
▼
get_list
1
list[str]
▼
def get_list(self, key: str) -> list[str]
Parameters
| Name | Type | Description |
|---|---|---|
key |
— |
Returns
list[str]
Internal Methods 4 ▼
__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