Lines Matching refs:self
95 def __hash__(self):
110 def __await__(self):
127 def send(self, value):
134 def throw(self, typ, val=None, tb=None):
146 def close(self):
150 self.throw(GeneratorExit)
171 def __aiter__(self):
188 async def __anext__(self):
192 def __aiter__(self):
193 return self
206 async def __anext__(self):
210 return await self.asend(None)
213 async def asend(self, value):
220 async def athrow(self, typ, val=None, tb=None):
232 async def aclose(self):
236 await self.athrow(GeneratorExit)
258 def __iter__(self):
276 def __next__(self):
280 def __iter__(self):
281 return self
311 def __reversed__(self):
326 def __next__(self):
330 return self.send(None)
333 def send(self, value):
340 def throw(self, typ, val=None, tb=None):
352 def close(self):
356 self.throw(GeneratorExit)
378 def __len__(self):
393 def __contains__(self, x):
440 def __repr__(self):
441 if len(self.__args__) == 2 and _is_param_expr(self.__args__[0]):
444 f'[[{", ".join([_type_repr(a) for a in self.__args__[:-1]])}], '
445 f'{_type_repr(self.__args__[-1])}]')
447 def __reduce__(self):
448 args = self.__args__
453 def __getitem__(self, item):
463 if (len(self.__parameters__) == 1
464 and _is_param_expr(self.__parameters__[0])
513 def __call__(self, *args, **kwds):
541 def __le__(self, other):
544 if len(self) > len(other):
546 for elem in self:
551 def __lt__(self, other):
554 return len(self) < len(other) and self.__le__(other)
556 def __gt__(self, other):
559 return len(self) > len(other) and self.__ge__(other)
561 def __ge__(self, other):
564 if len(self) < len(other):
567 if elem not in self:
571 def __eq__(self, other):
574 return len(self) == len(other) and self.__le__(other)
585 def __and__(self, other):
588 return self._from_iterable(value for value in other if value in self)
592 def isdisjoint(self, other):
595 if value in self:
599 def __or__(self, other):
602 chain = (e for s in (self, other) for e in s)
603 return self._from_iterable(chain)
607 def __sub__(self, other):
611 other = self._from_iterable(other)
612 return self._from_iterable(value for value in self
615 def __rsub__(self, other):
619 other = self._from_iterable(other)
620 return self._from_iterable(value for value in other
621 if value not in self)
623 def __xor__(self, other):
627 other = self._from_iterable(other)
628 return (self - other) | (other - self)
632 def _hash(self):
649 n = len(self)
652 for x in self:
684 def add(self, value):
689 def discard(self, value):
693 def remove(self, value):
695 if value not in self:
697 self.discard(value)
699 def pop(self):
701 it = iter(self)
706 self.discard(value)
709 def clear(self):
713 self.pop()
717 def __ior__(self, it):
719 self.add(value)
720 return self
722 def __iand__(self, it):
723 for value in (self - it):
724 self.discard(value)
725 return self
727 def __ixor__(self, it):
728 if it is self:
729 self.clear()
732 it = self._from_iterable(it)
734 if value in self:
735 self.discard(value)
737 self.add(value)
738 return self
740 def __isub__(self, it):
741 if it is self:
742 self.clear()
745 self.discard(value)
746 return self
768 def __getitem__(self, key):
771 def get(self, key, default=None):
774 return self[key]
778 def __contains__(self, key):
780 self[key]
786 def keys(self):
788 return KeysView(self)
790 def items(self):
792 return ItemsView(self)
794 def values(self):
796 return ValuesView(self)
798 def __eq__(self, other):
801 return dict(self.items()) == dict(other.items())
812 def __init__(self, mapping):
813 self._mapping = mapping
815 def __len__(self):
816 return len(self._mapping)
818 def __repr__(self):
819 return '{0.__class__.__name__}({0._mapping!r})'.format(self)
832 def __contains__(self, key):
833 return key in self._mapping
835 def __iter__(self):
836 yield from self._mapping
850 def __contains__(self, item):
853 v = self._mapping[key]
859 def __iter__(self):
860 for key in self._mapping:
861 yield (key, self._mapping[key])
871 def __contains__(self, value):
872 for key in self._mapping:
873 v = self._mapping[key]
878 def __iter__(self):
879 for key in self._mapping:
880 yield self._mapping[key]
898 def __setitem__(self, key, value):
902 def __delitem__(self, key):
907 def pop(self, key, default=__marker):
912 value = self[key]
914 if default is self.__marker:
918 del self[key]
921 def popitem(self):
926 key = next(iter(self))
929 value = self[key]
930 del self[key]
933 def clear(self):
937 self.popitem()
941 def update(self, other=(), /, **kwds):
949 self[key] = other[key]
952 self[key] = other[key]
955 self[key] = value
957 self[key] = value
959 def setdefault(self, key, default=None):
962 return self[key]
964 self[key] = default
986 def __getitem__(self, index):
989 def __iter__(self):
993 v = self[i]
999 def __contains__(self, value):
1000 for v in self:
1005 def __reversed__(self):
1006 for i in reversed(range(len(self))):
1007 yield self[i]
1009 def index(self, value, start=0, stop=None):
1017 start = max(len(self) + start, 0)
1019 stop += len(self)
1024 v = self[i]
1032 def count(self, value):
1034 return sum(1 for v in self if v is value or v == value)
1064 def __setitem__(self, index, value):
1068 def __delitem__(self, index):
1072 def insert(self, index, value):
1076 def append(self, value):
1078 self.insert(len(self), value)
1080 def clear(self):
1084 self.pop()
1088 def reverse(self):
1090 n = len(self)
1092 self[i], self[n-i-1] = self[n-i-1], self[i]
1094 def extend(self, values):
1096 if values is self:
1099 self.append(v)
1101 def pop(self, index=-1):
1105 v = self[index]
1106 del self[index]
1109 def remove(self, value):
1113 del self[self.index(value)]
1115 def __iadd__(self, values):
1116 self.extend(values)
1117 return self