omnipy.shared.protocols.typing
| CLASS | DESCRIPTION |
|---|---|
IsAbstractSet |
Protocol with the same interface as the abstract class |
IsBinaryIO |
Protocol with the same interface as the abstract class |
IsHashable |
|
IsIO |
Protocol with the same interface as the abstract class |
IsItemSequence |
Protocol with the same interface as the abstract class |
IsItemsView |
Protocol with the same interface as the abstract class |
IsKeysView |
Protocol with the same interface as the abstract class |
IsMapping |
Protocol with the same interface as the abstract class |
IsMappingView |
Protocol with the same interface as the abstract class |
IsMutableMapping |
Protocol with the same interface as the abstract class |
IsMutableSequence |
Protocol with the same interface as the abstract class |
IsMutableSet |
Protocol with the same interface as the abstract class |
IsTextIO |
|
IsValuesView |
Protocol with the same interface as the abstract class |
IsAbstractSet
Bases: Collection[_T_co], Protocol[_T_co]
Protocol with the same interface as the abstract class typing.AbstractSet.
| METHOD | DESCRIPTION |
|---|---|
isdisjoint |
|
Source code in src/omnipy/shared/protocols/typing.py
isdisjoint
Source code in src/omnipy/shared/protocols/typing.py
IsBinaryIO
Bases: IsIO[bytes], Protocol
Protocol with the same interface as the abstract class typing.BinaryIO.
| METHOD | DESCRIPTION |
|---|---|
close |
|
fileno |
|
flush |
|
isatty |
|
read |
|
readable |
|
readline |
|
readlines |
|
seek |
|
seekable |
|
tell |
|
truncate |
|
writable |
|
write |
|
writelines |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
closed |
TYPE:
|
mode |
TYPE:
|
name |
TYPE:
|
Source code in src/omnipy/shared/protocols/typing.py
close
Source code in src/omnipy/shared/protocols/typing.py
fileno
Source code in src/omnipy/shared/protocols/typing.py
flush
Source code in src/omnipy/shared/protocols/typing.py
isatty
Source code in src/omnipy/shared/protocols/typing.py
read
Source code in src/omnipy/shared/protocols/typing.py
readable
Source code in src/omnipy/shared/protocols/typing.py
readline
Source code in src/omnipy/shared/protocols/typing.py
readlines
Source code in src/omnipy/shared/protocols/typing.py
seek
Source code in src/omnipy/shared/protocols/typing.py
seekable
Source code in src/omnipy/shared/protocols/typing.py
tell
Source code in src/omnipy/shared/protocols/typing.py
truncate
Source code in src/omnipy/shared/protocols/typing.py
writable
Source code in src/omnipy/shared/protocols/typing.py
write
Source code in src/omnipy/shared/protocols/typing.py
writelines
IsHashable
Bases: Protocol
Source code in src/omnipy/shared/protocols/typing.py
IsIO
Bases: Protocol[AnyStr]
Protocol with the same interface as the abstract class typing.IO.
| METHOD | DESCRIPTION |
|---|---|
close |
|
fileno |
|
flush |
|
isatty |
|
read |
|
readable |
|
readline |
|
readlines |
|
seek |
|
seekable |
|
tell |
|
truncate |
|
writable |
|
write |
|
writelines |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
closed |
TYPE:
|
mode |
TYPE:
|
name |
TYPE:
|
Source code in src/omnipy/shared/protocols/typing.py
1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 | |
close
Source code in src/omnipy/shared/protocols/typing.py
fileno
Source code in src/omnipy/shared/protocols/typing.py
flush
Source code in src/omnipy/shared/protocols/typing.py
isatty
Source code in src/omnipy/shared/protocols/typing.py
read
Source code in src/omnipy/shared/protocols/typing.py
readable
Source code in src/omnipy/shared/protocols/typing.py
readline
Source code in src/omnipy/shared/protocols/typing.py
readlines
Source code in src/omnipy/shared/protocols/typing.py
seek
Source code in src/omnipy/shared/protocols/typing.py
seekable
Source code in src/omnipy/shared/protocols/typing.py
tell
Source code in src/omnipy/shared/protocols/typing.py
truncate
Source code in src/omnipy/shared/protocols/typing.py
writable
Source code in src/omnipy/shared/protocols/typing.py
write
Source code in src/omnipy/shared/protocols/typing.py
writelines
IsItemSequence
Bases: Reversible[_T_co], Collection[_T_co], Protocol[_T_co]
Protocol with the same interface as the abstract class typing.Sequence.
Note that with no custom handling, as is typically done in a type
checker, the string, bytes, and bytearray types will not be
considered Sequences by this protocol, due to differences in the
__contains__ method.
| METHOD | DESCRIPTION |
|---|---|
count |
S.count(value) -> integer -- return number of occurrences of value |
index |
S.index(value, [start, [stop]]) -> integer -- return first index of value. |
Source code in src/omnipy/shared/protocols/typing.py
count
index
S.index(value, [start, [stop]]) -> integer -- return first index of value. Raises ValueError if the value is not present.
Supporting start and stop arguments is optional, but recommended.
Source code in src/omnipy/shared/protocols/typing.py
IsItemsView
Bases: IsMappingView, IsAbstractSet[tuple[_KT_co, _VT_co]], Protocol[_KT_co, _VT_co]
Protocol with the same interface as the abstract class typing.ItemsView.
| METHOD | DESCRIPTION |
|---|---|
isdisjoint |
|
Source code in src/omnipy/shared/protocols/typing.py
isdisjoint
Source code in src/omnipy/shared/protocols/typing.py
IsKeysView
Bases: IsMappingView, IsAbstractSet[_KT_co], Protocol[_KT_co]
Protocol with the same interface as the abstract class typing.KeysView.
| METHOD | DESCRIPTION |
|---|---|
isdisjoint |
|
Source code in src/omnipy/shared/protocols/typing.py
isdisjoint
Source code in src/omnipy/shared/protocols/typing.py
IsMapping
Bases: Collection[_KT], Protocol[_KT, _VT_co]
Protocol with the same interface as the abstract class typing.Mapping.
IsMapping is the protocol of a generic container for associating key/value pairs.
| METHOD | DESCRIPTION |
|---|---|
get |
D.get(k[,d]) -> D[k] if k in D, else d. d defaults to None. |
keys |
D.keys() -> a set-like object providing a view on D's keys |
values |
D.values() -> an object providing a view on D's values |
Source code in src/omnipy/shared/protocols/typing.py
get
D.get(k[,d]) -> D[k] if k in D, else d. d defaults to None.
keys
keys() -> IsKeysView[_KT]
values
values() -> IsValuesView[_VT_co]
IsMappingView
Bases: Protocol
Protocol with the same interface as the abstract class typing.MappingView.
Source code in src/omnipy/shared/protocols/typing.py
IsMutableMapping
Bases: IsMapping[_KT, _VT], Protocol[_KT, _VT]
Protocol with the same interface as the abstract class typing.MutableMapping.
IsMutableMapping is the protocol of a generic mutable container for associating key/value pairs.
| METHOD | DESCRIPTION |
|---|---|
clear |
D.clear() -> None. Remove all items from D. |
get |
D.get(k[,d]) -> D[k] if k in D, else d. d defaults to None. |
keys |
D.keys() -> a set-like object providing a view on D's keys |
pop |
D.pop(k[,d]) -> v, remove specified key and return the corresponding value. |
popitem |
D.popitem() -> (k, v), remove and return some (key, value) pair |
setdefault |
D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D |
update |
D.update([E, ]**F) -> None. Update D from mapping/iterable E and F. |
values |
D.values() -> an object providing a view on D's values |
Source code in src/omnipy/shared/protocols/typing.py
978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 | |
clear
get
D.get(k[,d]) -> D[k] if k in D, else d. d defaults to None.
keys
keys() -> IsKeysView[_KT]
pop
D.pop(k[,d]) -> v, remove specified key and return the corresponding value. If key is not found, d is returned if given, otherwise KeyError is raised.
Source code in src/omnipy/shared/protocols/typing.py
popitem
D.popitem() -> (k, v), remove and return some (key, value) pair as a 2-tuple; but raise KeyError if D is empty.
setdefault
D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D
update
update(
m: SupportsKeysAndGetItem[_KT, _VT]
| SupportsKeysAndGetItem[str, _VT]
| Iterable[tuple[_KT, _VT]]
| Iterable[tuple[str, _VT]]
| None = None,
/,
**kwargs: _VT,
) -> None
D.update([E, ]**F) -> None. Update D from mapping/iterable E and F. If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
Source code in src/omnipy/shared/protocols/typing.py
values
values() -> IsValuesView[_VT_co]
IsMutableSequence
Bases: IsItemSequence[_T], Protocol[_T]
Protocol with the same interface as the abstract class typing.MutableSequence.
| METHOD | DESCRIPTION |
|---|---|
append |
S.append(value) -- append value to the end of the sequence |
clear |
S.clear() -> None -- remove all items from S |
count |
S.count(value) -> integer -- return number of occurrences of value |
extend |
S.extend(iterable) -- extend sequence by appending elements from the iterable |
index |
S.index(value, [start, [stop]]) -> integer -- return first index of value. |
insert |
S.insert(index, value) -- insert value before index |
pop |
S.pop([index]) -> item -- remove and return item at index (default last). |
remove |
S.remove(value) -- remove first occurrence of value. |
reverse |
S.reverse() -- reverse IN PLACE |
Source code in src/omnipy/shared/protocols/typing.py
749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 | |
append
clear
count
extend
S.extend(iterable) -- extend sequence by appending elements from the iterable
index
S.index(value, [start, [stop]]) -> integer -- return first index of value. Raises ValueError if the value is not present.
Supporting start and stop arguments is optional, but recommended.
Source code in src/omnipy/shared/protocols/typing.py
insert
pop
S.pop([index]) -> item -- remove and return item at index (default last). Raise IndexError if list is empty or index is out of range.
remove
S.remove(value) -- remove first occurrence of value. Raise ValueError if the value is not present.
IsMutableSet
Bases: IsAbstractSet[_T], Protocol[_T]
Protocol with the same interface as the abstract class typing.MutableSet.
| METHOD | DESCRIPTION |
|---|---|
add |
|
clear |
|
discard |
|
isdisjoint |
|
pop |
|
remove |
|
Source code in src/omnipy/shared/protocols/typing.py
add
Source code in src/omnipy/shared/protocols/typing.py
clear
Source code in src/omnipy/shared/protocols/typing.py
discard
Source code in src/omnipy/shared/protocols/typing.py
isdisjoint
Source code in src/omnipy/shared/protocols/typing.py
pop
Source code in src/omnipy/shared/protocols/typing.py
remove
Source code in src/omnipy/shared/protocols/typing.py
IsTextIO
Bases: IsIO[str], Protocol
| METHOD | DESCRIPTION |
|---|---|
close |
|
fileno |
|
flush |
|
isatty |
|
read |
|
readable |
|
readline |
|
readlines |
|
seek |
|
seekable |
|
tell |
|
truncate |
|
writable |
|
write |
|
writelines |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
buffer |
TYPE:
|
closed |
TYPE:
|
encoding |
TYPE:
|
errors |
TYPE:
|
line_buffering |
TYPE:
|
mode |
TYPE:
|
name |
TYPE:
|
newlines |
TYPE:
|
Source code in src/omnipy/shared/protocols/typing.py
close
Source code in src/omnipy/shared/protocols/typing.py
fileno
Source code in src/omnipy/shared/protocols/typing.py
flush
Source code in src/omnipy/shared/protocols/typing.py
isatty
Source code in src/omnipy/shared/protocols/typing.py
read
Source code in src/omnipy/shared/protocols/typing.py
readable
Source code in src/omnipy/shared/protocols/typing.py
readline
Source code in src/omnipy/shared/protocols/typing.py
readlines
Source code in src/omnipy/shared/protocols/typing.py
seek
Source code in src/omnipy/shared/protocols/typing.py
seekable
Source code in src/omnipy/shared/protocols/typing.py
tell
Source code in src/omnipy/shared/protocols/typing.py
truncate
Source code in src/omnipy/shared/protocols/typing.py
writable
Source code in src/omnipy/shared/protocols/typing.py
write
Source code in src/omnipy/shared/protocols/typing.py
writelines
IsValuesView
Bases: IsMappingView, Collection[_VT_co], Protocol[_VT_co]
Protocol with the same interface as the abstract class typing.ValuesView.