patroni.collections module
Patroni custom object types somewhat like collections
module.
- class _patroni.collections.CaseInsensitiveDict(_data: Dict[ str, Any] | None = None) View on GitHub
-
Bases:
MutableMapping
[str
,Any
] + A case-insensitivedict
-like object. + Implements all methods and operations ofMutableMapping
as well asdict
’scopy()
. All keys are expected to be strings. The structure remembers the case of the last key to be set, anditer()
,dict.keys()
,dict.items()
,dict.iterkeys()
, anddict.iteritems()
will contain case-sensitive keys. However, querying and contains testing is case insensitive. +- __init\\__(data: Dict[ str, Any] | None = None) → None View on GitHub
-
Create a new instance of
CaseInsensitiveDict
with the given data. +- Parameters
-
data – initial dictionary to create a
CaseInsensitiveDict
from. +
- abc_impl = <_abc._abc_data object>_
-
+
- copy() → CaseInsensitiveDict View on GitHub
-
Create a copy of this dict. +
- Returns
-
a new dict object with the same keys and values of this dict. +
- keys() → KeysView[ str] View on GitHub
-
Return a new view of the dict’s keys. +
- Returns
-
a set-like object providing a view on the dict’s keys
- class _patroni.collections.CaseInsensitiveSet(_values: Collection[ str] | None = None) View on GitHub
-
Bases:
MutableSet
[str
] + A case-insensitiveset
-like object. + Implements all methods and operations ofMutableSet
. All values are expected to be strings. The structure remembers the case of the last value set, however, contains testing is case insensitive. +- __init\\__(values: Collection[ str] | None = None) → None View on GitHub
-
Create a new instance of
CaseInsensitiveSet
with the given values. +- Parameters
-
values – values to be added to the set. +
- abc_impl = <_abc._abc_data object>_
-
+
- add(value: str) → None View on GitHub
-
Add value to this set. + Search is performed case-insensitively. If value is already in the set, overwrite it with value, so we “remember” the last case of value. +
- Parameters
-
value – value to be added to the set. +
- discard(value: str) → None View on GitHub
-
Remove value from this set. + Search is performed case-insensitively. If value is not present in the set, no exception is raised. +
- Parameters
-
value – value to be removed from the set. +
- issubset(other: CaseInsensitiveSet) → bool View on GitHub
-
Check if this set is a subset of other. +
- Parameters
-
other – another set to be compared with this set.
- Returns
-
True
if this set is a subset of other, elseFalse
.
© Copyright 2015 Compose, Zalando SE. Revision 3d527f57
.
Built with Sphinx using a theme provided by Read the Docs.
Read the Docs v: master