PyoContainer
Bases: Checkable, Protocol
flowchart TD
pyochain.abc._collection.PyoContainer[PyoContainer]
pyochain.abc._mixins.Checkable[Checkable]
pyochain.abc._mixins.Checkable --> pyochain.abc._collection.PyoContainer
click pyochain.abc._collection.PyoContainer href "" "pyochain.abc._collection.PyoContainer"
click pyochain.abc._mixins.Checkable href "" "pyochain.abc._mixins.Checkable"
ABC for collections.abc.Container Protocol.
Source code in pyochain/abc/_collection.pyi
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | |
contains(value)
Check if the Container contains the specified value.
This is equivalent to value in self, but as a method.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
T
|
The value to check for existence. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if the value exists in the Collection, False otherwise. |
Example
from pyochain import Dict
data = Dict(a=1, b=2)
assert data.contains("a")
assert not data.contains("c")
Source code in pyochain/abc/_collection.pyi
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | |