STD Types
This part of the documentation shows some wrappers around Python's builtin types.
monad_std.std_types.MDict
Bases: Generic[K, V]
, Dict[K, V]
Source code in monad_std/std_types/pydict.py
get(key)
Get the value by the key.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key |
K
|
The key to the value you want. |
required |
Examples:
pop(key)
Pop a value from the dict.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key |
K
|
The key to pop. |
required |
Returns:
Type | Description |
---|---|
Option[V]
|
The value under the key |
Examples:
monad_std.std_types.MList
Bases: Generic[KT]
, List[KT]
Source code in monad_std/std_types/pylist.py
get(index)
Get an item from the list.
Returns:
Type | Description |
---|---|
Option[KT]
|
The value at the given index, or |
Examples:
index(*args, **kwargs)
Return first index of value.
Actual Method Signature
Parameters:
Name | Type | Description | Default |
---|---|---|---|
__value |
KT
|
Value to search for. |
required |
__start |
SupportsIndex
|
Start index. |
...
|
__stop |
SupportsIndex
|
Stop index. |
...
|
Returns:
Type | Description |
---|---|
Option[int]
|
First index of the value, or |
Examples:
pop(*args, **kwargs)
Pop a value from the list.
Actual Method Signature
Parameters:
Name | Type | Description | Default |
---|---|---|---|
__index |
SupportsIndex
|
The index to pop. Optional |
...
|
Returns:
Type | Description |
---|---|
Option[KT]
|
The last value or the value at the given index, or |
Examples:
monad_std.std_types.MSet
Bases: Generic[K]
, Set[K]
Source code in monad_std/std_types/pyset.py
pop()
Remove and return an arbitrary set element.
Returns:
Type | Description |
---|---|
Option[K]
|
The popped element. |
Examples:
monad_std.std_types.MTuple
Bases: Tuple
Source code in monad_std/std_types/pytuple.py
get(index)
Get an item from the tuple.
Returns:
Type | Description |
---|---|
Option[Any]
|
The value at the given index, or |
index(*args, **kwargs)
Return first index of value.
Actual Method Signature
Parameters:
Name | Type | Description | Default |
---|---|---|---|
__value |
Any
|
Value to search for. |
required |
__start |
SupportsIndex
|
Start index. |
...
|
__stop |
SupportsIndex
|
Stop index. |
...
|
Returns:
Type | Description |
---|---|
int
|
First index of the value, or |