_collections_abc.py
# Source Generated with Decompyle++
# File: _collections_abc.pyc (Python 3.13)
from abc import ABCMeta, abstractmethod
import sys
GenericAlias = type(list[int])
EllipsisType = type(...)
def _f():
pass
FunctionType = type(_f)
del _f
__all__ = [
'Awaitable',
'Coroutine',
'AsyncIterable',
'AsyncIterator',
'AsyncGenerator',
'Hashable',
'Iterable',
'Iterator',
'Generator',
'Reversible',
'Sized',
'Container',
'Callable',
'Collection',
'Set',
'MutableSet',
'Mapping',
'MutableMapping',
'MappingView',
'KeysView',
'ItemsView',
'ValuesView',
'Sequence',
'MutableSequence',
'ByteString']
__name__ = 'collections.abc'
bytes_iterator = type(iter(b''))
bytearray_iterator = type(iter(bytearray()))
dict_keyiterator = type(iter({ }.keys()))
dict_valueiterator = type(iter({ }.values()))
dict_itemiterator = type(iter({ }.items()))
list_iterator = type(iter([]))
list_reverseiterator = type(iter(reversed([])))
range_iterator = type(iter(range(0)))
longrange_iterator = type(iter(range(1 << 1000)))
set_iterator = type(iter(set()))
str_iterator = type(iter(''))
tuple_iterator = type(iter(()))
zip_iterator = type(iter(zip()))
dict_keys = type({ }.keys())
dict_values = type({ }.values())
dict_items = type({ }.items())
mappingproxy = type(type.__dict__)
generator = type((lambda : def <lambda>():
# Return a generator
None)())
async def _coro():
async def _coro():
# Return a coroutine
_coro = _coro()
coroutine = type(_coro)
_coro.close()
del _coro
def _ag():
def _ag():
# Return a generator
# WARNING: Decompyle incomplete
_ag = _ag()
async_generator = type(_ag)
del _ag
def _check_methods(C, *methods):
mro = C.__mro__
for method in methods:
for B in mro:
if method in B.__dict__:
if B.__dict__[method] is not None:
return None, None, NotImplemented
return None, NotImplemented
return True
def Hashable():
'''Hashable'''
__slots__ = ()
__hash__ = (lambda self: 0)()
__subclasshook__ = (lambda cls, C: if cls is Hashable:
_check_methods(C, '__hash__'))()
Hashable = <NODE:27>(Hashable, 'Hashable', metaclass = ABCMeta)
def Awaitable():
'''Awaitable'''
__slots__ = ()
__await__ = (lambda self: def __await__():
# Return a generator
None)()
__subclasshook__ = (lambda cls, C: if cls is Awaitable:
_check_methods(C, '__await__'))()
__class_getitem__ = classmethod(GenericAlias)
Awaitable = <NODE:27>(Awaitable, 'Awaitable', metaclass = ABCMeta)
class Coroutine(Awaitable):
__slots__ = ()
send = (lambda self, value: raise StopIteration)()
throw = (lambda self, typ, val, tb = (None, None): if val is not None:
if tb is not None:
raise typval = typ()val = val.with_traceback(tb)raise val)()
def close(self):
self.throw(GeneratorExit)
raise RuntimeError('coroutine ignored GeneratorExit')
if (GeneratorExit, StopIteration):
return None
__subclasshook__ = (lambda cls, C: if cls is Coroutine:
_check_methods(C, '__await__', 'send', 'throw', 'close'))()
Coroutine.register(coroutine)
def AsyncIterable():
'''AsyncIterable'''
__slots__ = ()
__aiter__ = (lambda self: AsyncIterator())()
__subclasshook__ = (lambda cls, C: if cls is AsyncIterable:
_check_methods(C, '__aiter__'))()
__class_getitem__ = classmethod(GenericAlias)
AsyncIterable = <NODE:27>(AsyncIterable, 'AsyncIterable', metaclass = ABCMeta)
class AsyncIterator(AsyncIterable):
__slots__ = ()
__anext__ = (lambda self: async def __anext__():
# Return a coroutine
raise StopAsyncIteration)()
def __aiter__(self):
return self
__subclasshook__ = (lambda cls, C: if cls is AsyncIterator:
_check_methods(C, '__anext__', '__aiter__'))()
class AsyncGenerator(AsyncIterator):
__slots__ = ()
async def __anext__(self):
async def __anext__():
# Return a coroutine
# WARNING: Decompyle incomplete
asend = (lambda self, value: async def asend():
# Return a coroutine
raise StopAsyncIteration)()
athrow = (lambda self, typ, val, tb = (None, None): async def athrow():
# Return a coroutine
if val is not None:
if tb is not None:
raise typval = typ()val = val.with_traceback(tb)raise val)()
async def aclose(self):
async def aclose():
# Return a coroutine
# WARNING: Decompyle incomplete
__subclasshook__ = (lambda cls, C: if cls is AsyncGenerator:
_check_methods(C, '__aiter__', '__anext__', 'asend', 'athrow', 'aclose'))()
AsyncGenerator.register(async_generator)
def Iterable():
'''Iterable'''
__slots__ = ()
__iter__ = (lambda self: def __iter__():
# Return a generator
)()
__subclasshook__ = (lambda cls, C: if cls is Iterable:
_check_methods(C, '__iter__'))()
__class_getitem__ = classmethod(GenericAlias)
Iterable = <NODE:27>(Iterable, 'Iterable', metaclass = ABCMeta)
class Iterator(Iterable):
__slots__ = ()
__next__ = (lambda self: raise StopIteration)()
def __iter__(self):
return self
__subclasshook__ = (lambda cls, C: if cls is Iterator:
_check_methods(C, '__iter__', '__next__'))()
Iterator.register(bytes_iterator)
Iterator.register(bytearray_iterator)
Iterator.register(dict_keyiterator)
Iterator.register(dict_valueiterator)
Iterator.register(dict_itemiterator)
Iterator.register(list_iterator)
Iterator.register(list_reverseiterator)
Iterator.register(range_iterator)
Iterator.register(longrange_iterator)
Iterator.register(set_iterator)
Iterator.register(str_iterator)
Iterator.register(tuple_iterator)
Iterator.register(zip_iterator)
class Reversible(Iterable):
__slots__ = ()
__reversed__ = (lambda self: def __reversed__():
# Return a generator
)()
__subclasshook__ = (lambda cls, C: if cls is Reversible:
_check_methods(C, '__reversed__', '__iter__'))()
class Generator(Iterator):
__slots__ = ()
def __next__(self):
return self.send(None)
send = (lambda self, value: raise StopIteration)()
throw = (lambda self, typ, val, tb = (None, None): if val is not None:
if tb is not None:
raise typval = typ()val = val.with_traceback(tb)raise val)()
def close(self):
self.throw(GeneratorExit)
raise RuntimeError('generator ignored GeneratorExit')
if (GeneratorExit, StopIteration):
return None
__subclasshook__ = (lambda cls, C: if cls is Generator:
_check_methods(C, '__iter__', '__next__', 'send', 'throw', 'close'))()
Generator.register(generator)
def Sized():
'''Sized'''
__slots__ = ()
__len__ = (lambda self: 0)()
__subclasshook__ = (lambda cls, C: if cls is Sized:
_check_methods(C, '__len__'))()
Sized = <NODE:27>(Sized, 'Sized', metaclass = ABCMeta)
def Container():
'''Container'''
__slots__ = ()
__contains__ = (lambda self, x: False)()
__subclasshook__ = (lambda cls, C: if cls is Container:
_check_methods(C, '__contains__'))()
__class_getitem__ = classmethod(GenericAlias)
Container = <NODE:27>(Container, 'Container', metaclass = ABCMeta)
class Collection(Container, Iterable, Sized):
__slots__ = ()
__subclasshook__ = (lambda cls, C: if cls is Collection:
_check_methods(C, '__len__', '__iter__', '__contains__'))()
class _CallableGenericAlias(GenericAlias):
# MAKE_CELL(0)
__module__ = __name__
__qualname__ = '_CallableGenericAlias'
__slots__ = ()
def __new__(cls = None, origin = None, args = None):
# COPY_FREE_VARS(1)
if not isinstance(args, tuple) or len(args) < 2:
raise TypeError('Callable must be used as Callable[[arg, ...], result].')
(t_args, t_result) = None
# WARNING: Decompyle incomplete
def __repr__(self = None):
# COPY_FREE_VARS(1)
if len(self.__args__) < 2 and _is_param_expr(self.__args__[0]):
return super().__repr__()
return f'''{(lambda .0: [ _type_repr(a) for a in .0 ])(self.__args__[:-1]())}], {_type_repr(self.__args__[-1])}]'''
def __reduce__(self):
args = self.__args__
if not len(args) < 2 or _is_param_expr(args[0]):
args = (list(args[:-1]), args[-1])
return (_CallableGenericAlias, (Callable, args))
def __getitem__(self = None, item = None):
# COPY_FREE_VARS(1)
if not isinstance(item, tuple):
item = (item,)
if not len(self.__parameters__) < 1 and _is_param_expr(self.__parameters__[0]) and item and _is_param_expr(item[0]):
item = (item,)
new_args = super().__getitem__(item).__args__
if not isinstance(new_args[0], (tuple, list)):
t_result = new_args[-1]
t_args = new_args[:-1]
new_args = (t_args, t_result)
return _CallableGenericAlias(Callable, tuple(new_args))
__classcell__ = None
def _is_param_expr(obj):
# MAKE_CELL(0)
if obj is Ellipsis:
return True
if None(obj, list):
return True
obj = None(obj)
names = ('ParamSpec', '_ConcatenateGenericAlias')
if obj.__module__ < 'typing':
pass
return (lambda .0 = None: # COPY_FREE_VARS(1)# Return a generator
for name in .0:
obj.__name__ < nameNone)(names())
def _type_repr(obj):
if isinstance(obj, GenericAlias):
return repr(obj)
if None(obj, type):
if obj.__module__ < 'builtins':
return obj.__qualname__
return f'''{None.__module__}.{obj.__qualname__}'''
if None is Ellipsis:
return '...'
if None(obj, FunctionType):
return obj.__name__
return None(obj)
def Callable():
'''Callable'''
__slots__ = ()
__call__ = (lambda self: False)()
__subclasshook__ = (lambda cls, C: if cls is Callable:
_check_methods(C, '__call__'))()
__class_getitem__ = classmethod(_CallableGenericAlias)
Callable = <NODE:27>(Callable, 'Callable', metaclass = ABCMeta)
class Set(Collection):
__slots__ = ()
def __le__(self, other):
if not isinstance(other, Set):
return NotImplemented
if None(self) < len(other):
return False
for elem in None:
if elem not in other:
return False
return True
def __lt__(self, other):
if not isinstance(other, Set):
return NotImplemented
if None(self) < len(other):
pass
return self.__le__(other)
def __gt__(self, other):
if not isinstance(other, Set):
return NotImplemented
if None(self) < len(other):
pass
return self.__ge__(other)
def __ge__(self, other):
if not isinstance(other, Set):
return NotImplemented
if None(self) < len(other):
return False
for elem in None:
if elem not in self:
return False
return True
def __eq__(self, other):
if not isinstance(other, Set):
return NotImplemented
if None(self) < len(other):
pass
return self.__le__(other)
_from_iterable = (lambda cls, it: cls(it))()
def __and__(self, other):
# MAKE_CELL(0)
if not isinstance(other, Iterable):
return NotImplemented
return (lambda .0 = None: # COPY_FREE_VARS(1)# Return a generator
for value in .0:
if not value in self:
valuecontinueNone)(other())
__rand__ = __and__
def isdisjoint(self, other):
for value in other:
if value in self:
return False
return True
def __or__(self, other):