omlish 0.0.0.dev1__tar.gz → 0.0.0.dev2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of omlish might be problematic. Click here for more details.
- omlish-0.0.0.dev2/PKG-INFO +30 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/__about__.py +2 -2
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/argparse.py +4 -4
- omlish-0.0.0.dev2/omlish/asyncs/anyio.py +84 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/asyncs/futures.py +6 -6
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/c3.py +4 -4
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/check.py +6 -6
- omlish-0.0.0.dev2/omlish/collections/__init__.py +98 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/collections/cache/descriptor.py +5 -5
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/collections/cache/impl.py +4 -4
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/collections/coerce.py +43 -43
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/collections/frozen.py +3 -3
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/collections/identity.py +1 -1
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/collections/mappings.py +3 -3
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/collections/ordered.py +1 -1
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/collections/skiplist.py +6 -6
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/collections/sorted.py +3 -3
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/collections/treap.py +17 -17
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/collections/treapmap.py +2 -2
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/collections/unmodifiable.py +28 -27
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/configs/flattening.py +1 -1
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/configs/props.py +1 -1
- omlish-0.0.0.dev2/omlish/dataclasses/impl/__init__.py +8 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/dataclasses/impl/api.py +5 -13
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/dataclasses/impl/fields.py +1 -1
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/dataclasses/impl/init.py +1 -1
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/dataclasses/impl/internals.py +15 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/dataclasses/impl/main.py +4 -4
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/dataclasses/impl/metaclass.py +1 -1
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/dataclasses/impl/metadata.py +1 -1
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/dataclasses/impl/order.py +1 -1
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/dataclasses/impl/params.py +4 -38
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/dataclasses/impl/reflect.py +1 -7
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/dataclasses/impl/repr.py +23 -5
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/dataclasses/impl/simple.py +2 -2
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/dataclasses/impl/slots.py +2 -2
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/dataclasses/impl/utils.py +4 -4
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/dispatch/dispatch.py +9 -8
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/dispatch/methods.py +2 -2
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/docker.py +8 -6
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/dynamic.py +5 -5
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/graphs/dot/items.py +1 -1
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/graphs/trees.py +15 -21
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/inject/elements.py +1 -1
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/inject/exceptions.py +1 -1
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/inject/impl/injector.py +1 -1
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/inject/impl/inspect.py +1 -1
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/inject/injector.py +1 -1
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/inject/providers.py +2 -2
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/iterators.py +43 -2
- omlish-0.0.0.dev2/omlish/lang/__init__.py +167 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/lang/cached.py +13 -5
- omlish-0.0.0.dev2/omlish/lang/classes/__init__.py +35 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/lang/classes/abstract.py +1 -1
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/lang/classes/simple.py +1 -1
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/lang/clsdct.py +1 -1
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/lang/contextmanagers.py +23 -15
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/lang/datetimes.py +1 -1
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/lang/descriptors.py +35 -2
- omlish-0.0.0.dev2/omlish/lang/exceptions.py +2 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/lang/functions.py +43 -13
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/lang/imports.py +8 -8
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/lang/iterables.py +1 -1
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/lang/maybes.py +1 -1
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/lang/objects.py +2 -2
- omlish-0.0.0.dev2/omlish/lang/timeouts.py +53 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/lang/typing.py +2 -2
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/libc.py +6 -6
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/marshal/base.py +6 -6
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/marshal/dataclasses.py +2 -2
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/marshal/enums.py +2 -2
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/marshal/factories.py +10 -10
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/marshal/iterables.py +2 -2
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/marshal/mappings.py +2 -2
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/marshal/optionals.py +4 -4
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/marshal/polymorphism.py +4 -4
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/marshal/standard.py +6 -6
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/marshal/utils.py +1 -1
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/os.py +13 -4
- omlish-0.0.0.dev2/omlish/procfs.py +336 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/reflect.py +2 -12
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/replserver/console.py +9 -9
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/replserver/server.py +4 -4
- omlish-0.0.0.dev2/omlish/sql/_abcs.py +65 -0
- omlish-0.0.0.dev2/omlish/sql/dbs.py +90 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/stats.py +3 -3
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/testing/pydevd.py +4 -6
- omlish-0.0.0.dev2/omlish/testing/pytest/inject/__init__.py +8 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/testing/pytest/inject/harness.py +23 -1
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/testing/pytest/plugins/__init__.py +1 -1
- omlish-0.0.0.dev2/omlish/testing/pytest/plugins/pydevd.py +12 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/testing/pytest/plugins/switches.py +2 -2
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/testing/testing.py +5 -5
- omlish-0.0.0.dev2/omlish/text/__init__.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/text/parts.py +3 -3
- omlish-0.0.0.dev2/omlish.egg-info/PKG-INFO +30 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish.egg-info/SOURCES.txt +8 -1
- omlish-0.0.0.dev2/omlish.egg-info/requires.txt +24 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/pyproject.toml +76 -18
- omlish-0.0.0.dev1/PKG-INFO +0 -16
- omlish-0.0.0.dev1/omlish/asyncs/anyio.py +0 -23
- omlish-0.0.0.dev1/omlish/collections/__init__.py +0 -63
- omlish-0.0.0.dev1/omlish/dataclasses/impl/__init__.py +0 -6
- omlish-0.0.0.dev1/omlish/lang/__init__.py +0 -112
- omlish-0.0.0.dev1/omlish/lang/classes/__init__.py +0 -24
- omlish-0.0.0.dev1/omlish/testing/pytest/inject/__init__.py +0 -1
- omlish-0.0.0.dev1/omlish/testing/pytest/plugins/pycharm.py +0 -54
- omlish-0.0.0.dev1/omlish.egg-info/PKG-INFO +0 -16
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/LICENSE +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/MANIFEST.in +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/README.md +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/__init__.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/asyncs/__init__.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/asyncs/asyncio.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/asyncs/asyncs.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/asyncs/trio.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/cached.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/collections/_abc.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/collections/_io_abc.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/collections/cache/__init__.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/collections/cache/types.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/collections/indexed.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/collections/persistent.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/collections/utils.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/configs/__init__.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/dataclasses/__init__.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/dataclasses/impl/as_.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/dataclasses/impl/exceptions.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/dataclasses/impl/frozen.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/dataclasses/impl/hashing.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/dataclasses/impl/processing.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/dataclasses/impl/replace.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/defs.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/dispatch/__init__.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/dispatch/functions.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/graphs/__init__.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/graphs/dot/__init__.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/graphs/dot/rendering.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/graphs/dot/utils.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/http/__init__.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/http/consts.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/http/wsgi.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/inject/__init__.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/inject/binder.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/inject/bindings.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/inject/eagers.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/inject/impl/__init__.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/inject/impl/bindings.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/inject/impl/elements.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/inject/impl/private.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/inject/impl/providers.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/inject/impl/scopes.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/inject/inspect.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/inject/keys.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/inject/managed.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/inject/overrides.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/inject/private.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/inject/proxy.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/inject/scopes.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/inject/types.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/json.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/lang/classes/restrict.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/lang/classes/test/__init__.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/lang/classes/test/test_abstract.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/lang/classes/test/test_restrict.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/lang/classes/test/test_simple.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/lang/classes/test/test_virtual.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/lang/classes/virtual.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/lang/cmp.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/lang/resolving.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/lang/strings.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/logs/__init__.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/logs/_abc.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/logs/configs.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/logs/filters.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/logs/formatters.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/logs/utils.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/marshal/__init__.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/marshal/any.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/marshal/base64.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/marshal/datetimes.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/marshal/exceptions.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/marshal/global_.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/marshal/naming.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/marshal/objects.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/marshal/primitives.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/marshal/registries.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/marshal/uuids.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/marshal/values.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/math.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/replserver/__init__.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/replserver/__main__.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/runmodule.py +0 -0
- {omlish-0.0.0.dev1/omlish/text → omlish-0.0.0.dev2/omlish/sql}/__init__.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/term.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/testing/__init__.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/testing/pytest/__init__.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/testing/pytest/helpers.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/testing/pytest/plugins/_registry.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/testing/pytest/plugins/logging.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/testing/pytest/plugins/repeat.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/testing/pytest/plugins/skips.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/testing/pytest/plugins/spacing.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/text/delimit.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish/text/indent.py +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish.egg-info/dependency_links.txt +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/omlish.egg-info/top_level.txt +0 -0
- {omlish-0.0.0.dev1 → omlish-0.0.0.dev2}/setup.cfg +0 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: omlish
|
|
3
|
+
Version: 0.0.0.dev2
|
|
4
|
+
Summary: omlish
|
|
5
|
+
Author: wrmsr
|
|
6
|
+
License: BSD-3-Clause
|
|
7
|
+
Project-URL: source, https://github.com/wrmsr/omlish
|
|
8
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
9
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Requires-Python: >=3.12
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Provides-Extra: async
|
|
15
|
+
Requires-Dist: anyio; extra == "async"
|
|
16
|
+
Provides-Extra: http
|
|
17
|
+
Requires-Dist: httpx; extra == "http"
|
|
18
|
+
Provides-Extra: sql
|
|
19
|
+
Requires-Dist: sqlalchemy; extra == "sql"
|
|
20
|
+
Provides-Extra: wrapt
|
|
21
|
+
Requires-Dist: wrapt; extra == "wrapt"
|
|
22
|
+
Provides-Extra: yaml
|
|
23
|
+
Requires-Dist: pyyaml; extra == "yaml"
|
|
24
|
+
Provides-Extra: server
|
|
25
|
+
Requires-Dist: h11; extra == "server"
|
|
26
|
+
Requires-Dist: h2; extra == "server"
|
|
27
|
+
Requires-Dist: priority; extra == "server"
|
|
28
|
+
Requires-Dist: wsproto; extra == "server"
|
|
29
|
+
Provides-Extra: test
|
|
30
|
+
Requires-Dist: pytest; extra == "test"
|
|
@@ -48,7 +48,7 @@ ArgumentParser = argparse.ArgumentParser
|
|
|
48
48
|
class Arg:
|
|
49
49
|
args: ta.Sequence[ta.Any]
|
|
50
50
|
kwargs: ta.Mapping[str, ta.Any]
|
|
51
|
-
dest:
|
|
51
|
+
dest: str | None = None
|
|
52
52
|
|
|
53
53
|
def __get__(self, instance, owner=None):
|
|
54
54
|
if instance is None:
|
|
@@ -92,8 +92,8 @@ class Command:
|
|
|
92
92
|
|
|
93
93
|
def command(
|
|
94
94
|
*args: Arg,
|
|
95
|
-
name:
|
|
96
|
-
parent:
|
|
95
|
+
name: str | None = None,
|
|
96
|
+
parent: Command | None = None,
|
|
97
97
|
) -> ta.Any: # ta.Callable[[CommandFn], Command]: # FIXME
|
|
98
98
|
for arg in args:
|
|
99
99
|
check.isinstance(arg, Arg)
|
|
@@ -192,7 +192,7 @@ class _CliMeta(type):
|
|
|
192
192
|
|
|
193
193
|
class Cli(metaclass=_CliMeta):
|
|
194
194
|
|
|
195
|
-
def __init__(self, argv: ta.
|
|
195
|
+
def __init__(self, argv: ta.Sequence[str] | None = None) -> None:
|
|
196
196
|
super().__init__()
|
|
197
197
|
|
|
198
198
|
self._argv = argv if argv is not None else sys.argv[1:]
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"""
|
|
2
|
+
lookit:
|
|
3
|
+
- https://github.com/davidbrochart/sqlite-anyio/blob/a3ba4c6ef0535b14a5a60071fcd6ed565a514963/sqlite_anyio/sqlite.py
|
|
4
|
+
- https://github.com/rafalkrupinski/ratelimit-anyio/blob/2910a8a3d6fa54ed17ee6ba457686c9f7a4c4beb/src/ratelimit_anyio/__init__.py
|
|
5
|
+
- https://github.com/nekitdev/async-extensions/tree/main/async_extensions
|
|
6
|
+
- https://github.com/kinnay/anynet/tree/master/anynet
|
|
7
|
+
- https://github.com/M-o-a-T/asyncscope
|
|
8
|
+
- https://github.com/M-o-a-T/aevent
|
|
9
|
+
- https://github.com/florimondmanca/aiometer
|
|
10
|
+
- https://github.com/sanitizers/octomachinery/blob/b36c3d3d49da813ac46e361424132955a4e99ac8/octomachinery/utils/asynctools.py
|
|
11
|
+
""" # noqa
|
|
12
|
+
import typing as ta
|
|
13
|
+
|
|
14
|
+
import anyio.streams.memory
|
|
15
|
+
import anyio.streams.stapled
|
|
16
|
+
|
|
17
|
+
from .. import check
|
|
18
|
+
from .. import lang
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
T = ta.TypeVar('T')
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
async def anyio_eof_to_empty(fn: ta.Callable[..., ta.Awaitable[T]], *args: ta.Any, **kwargs: ta.Any) -> T | bytes:
|
|
25
|
+
try:
|
|
26
|
+
return await fn(*args, **kwargs)
|
|
27
|
+
except anyio.EndOfStream:
|
|
28
|
+
return b''
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def split_memory_object_streams(
|
|
32
|
+
*args: anyio.create_memory_object_stream[T],
|
|
33
|
+
) -> tuple[
|
|
34
|
+
anyio.streams.memory.MemoryObjectSendStream[T],
|
|
35
|
+
anyio.streams.memory.MemoryObjectReceiveStream[T],
|
|
36
|
+
]:
|
|
37
|
+
[tup] = args
|
|
38
|
+
return tup
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
# FIXME: https://github.com/python/mypy/issues/15238
|
|
42
|
+
# def create_memory_object_stream[T](max_buffer_size: float = 0) -> tuple[
|
|
43
|
+
# anyio.streams.memory.MemoryObjectSendStream[T],
|
|
44
|
+
# anyio.streams.memory.MemoryObjectReceiveStream[T],
|
|
45
|
+
# ]:
|
|
46
|
+
# return anyio.create_memory_object_stream[T](max_buffer_size)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def staple_memory_object_stream(
|
|
50
|
+
*args: anyio.create_memory_object_stream[T],
|
|
51
|
+
) -> anyio.streams.stapled.StapledObjectStream[T]:
|
|
52
|
+
send, receive = args
|
|
53
|
+
return anyio.streams.stapled.StapledObjectStream(
|
|
54
|
+
check.isinstance(send, anyio.streams.memory.MemoryObjectSendStream), # type: ignore
|
|
55
|
+
check.isinstance(receive, anyio.streams.memory.MemoryObjectReceiveStream), # type: ignore
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
# FIXME: https://github.com/python/mypy/issues/15238
|
|
60
|
+
# def staple_memory_object_stream2[T](max_buffer_size: float = 0) -> anyio.streams.stapled.StapledObjectStream[T]:
|
|
61
|
+
# send, receive = anyio.create_memory_object_stream[T](max_buffer_size)
|
|
62
|
+
# return anyio.streams.stapled.StapledObjectStream(
|
|
63
|
+
# check.isinstance(send, anyio.streams.memory.MemoryObjectSendStream), # type: ignore
|
|
64
|
+
# check.isinstance(receive, anyio.streams.memory.MemoryObjectReceiveStream), # type: ignore
|
|
65
|
+
# )
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
async def gather(*fns: ta.Callable[..., ta.Awaitable[T]], take_first: bool = False) -> list[lang.Maybe[T]]:
|
|
69
|
+
results: list[lang.Maybe[T]] = [lang.empty()] * len(fns)
|
|
70
|
+
|
|
71
|
+
async def inner(fn, i):
|
|
72
|
+
results[i] = lang.just(await fn())
|
|
73
|
+
if take_first:
|
|
74
|
+
tg.cancel_scope.cancel()
|
|
75
|
+
|
|
76
|
+
async with anyio.create_task_group() as tg:
|
|
77
|
+
for i, fn in enumerate(fns):
|
|
78
|
+
tg.start_soon(inner, fn, i)
|
|
79
|
+
|
|
80
|
+
return results
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
async def first(*fns: ta.Callable[..., ta.Awaitable[T]], **kwargs: ta.Any) -> list[lang.Maybe[T]]:
|
|
84
|
+
return await gather(*fns, take_first=True, **kwargs)
|
|
@@ -12,7 +12,7 @@ T = ta.TypeVar('T')
|
|
|
12
12
|
|
|
13
13
|
class FutureException(Exception, ta.Generic[T]):
|
|
14
14
|
|
|
15
|
-
def __init__(self, future: cf.Future, target:
|
|
15
|
+
def __init__(self, future: cf.Future, target: T | None = None) -> None:
|
|
16
16
|
super().__init__()
|
|
17
17
|
|
|
18
18
|
self._future = future
|
|
@@ -23,7 +23,7 @@ class FutureException(Exception, ta.Generic[T]):
|
|
|
23
23
|
return self._future
|
|
24
24
|
|
|
25
25
|
@property
|
|
26
|
-
def target(self) ->
|
|
26
|
+
def target(self) -> T | None:
|
|
27
27
|
return self._target
|
|
28
28
|
|
|
29
29
|
def __repr__(self) -> str:
|
|
@@ -44,8 +44,8 @@ class FutureTimeoutException(Exception):
|
|
|
44
44
|
def wait_futures(
|
|
45
45
|
futures: ta.Sequence[cf.Future],
|
|
46
46
|
*,
|
|
47
|
-
timeout_s:
|
|
48
|
-
tick_interval_s:
|
|
47
|
+
timeout_s: float = 60,
|
|
48
|
+
tick_interval_s: float = .5,
|
|
49
49
|
tick_fn: ta.Callable[..., bool] = lambda: True,
|
|
50
50
|
raise_exceptions: bool = False,
|
|
51
51
|
cancel_on_exception: bool = False,
|
|
@@ -78,8 +78,8 @@ def wait_dependent_futures(
|
|
|
78
78
|
executor: cf.Executor,
|
|
79
79
|
dependency_sets_by_fn: ta.Mapping[ta.Callable, ta.AbstractSet[ta.Callable]],
|
|
80
80
|
*,
|
|
81
|
-
timeout_s:
|
|
82
|
-
tick_interval_s:
|
|
81
|
+
timeout_s: float = 60,
|
|
82
|
+
tick_interval_s: float = .5,
|
|
83
83
|
tick_fn: ta.Callable[..., bool] = lambda: True,
|
|
84
84
|
) -> ta.Mapping[ta.Callable, cf.Future]:
|
|
85
85
|
for fn, deps in dependency_sets_by_fn.items():
|
|
@@ -49,7 +49,7 @@ def merge(seqs: ta.MutableSequence[list[T]]) -> list[T]:
|
|
|
49
49
|
"""
|
|
50
50
|
|
|
51
51
|
result: list[T] = []
|
|
52
|
-
candidate:
|
|
52
|
+
candidate: T | None = None
|
|
53
53
|
while True:
|
|
54
54
|
seqs = [s for s in seqs if s] # purge empty sequences
|
|
55
55
|
if not seqs:
|
|
@@ -73,7 +73,7 @@ def merge(seqs: ta.MutableSequence[list[T]]) -> list[T]:
|
|
|
73
73
|
|
|
74
74
|
def mro(
|
|
75
75
|
cls: T,
|
|
76
|
-
abcs: ta.
|
|
76
|
+
abcs: ta.Sequence[T] | None = None,
|
|
77
77
|
*,
|
|
78
78
|
get_bases: ta.Callable[[T], ta.Sequence[T]] = operator.attrgetter('__bases__'),
|
|
79
79
|
is_subclass: ta.Callable[[T, T], bool] = issubclass, # type: ignore
|
|
@@ -115,7 +115,7 @@ def mro(
|
|
|
115
115
|
return merge(
|
|
116
116
|
[[cls]] +
|
|
117
117
|
explicit_c3_mros + abstract_c3_mros + other_c3_mros +
|
|
118
|
-
[explicit_bases] + [abstract_bases] + [other_bases]
|
|
118
|
+
[explicit_bases] + [abstract_bases] + [other_bases],
|
|
119
119
|
)
|
|
120
120
|
|
|
121
121
|
|
|
@@ -123,7 +123,7 @@ def compose_mro(
|
|
|
123
123
|
cls: T,
|
|
124
124
|
types: ta.Iterable[T],
|
|
125
125
|
*,
|
|
126
|
-
get_mro: ta.Callable[[T], ta.
|
|
126
|
+
get_mro: ta.Callable[[T], ta.Sequence[T] | None] = operator.attrgetter('__mro__'),
|
|
127
127
|
get_bases: ta.Callable[[T], ta.Sequence[T]] = operator.attrgetter('__bases__'),
|
|
128
128
|
is_subclass: ta.Callable[[T, T], bool] = issubclass, # type: ignore
|
|
129
129
|
get_subclasses: ta.Callable[[T], ta.Iterable[T]] = operator.methodcaller('__subclasses__'),
|
|
@@ -9,7 +9,7 @@ import typing as ta
|
|
|
9
9
|
T = ta.TypeVar('T')
|
|
10
10
|
SizedT = ta.TypeVar('SizedT', bound=ta.Sized)
|
|
11
11
|
|
|
12
|
-
Message = ta.Union[str, ta.Callable[...,
|
|
12
|
+
Message = ta.Union[str, ta.Callable[..., str | None], None]
|
|
13
13
|
|
|
14
14
|
_NONE_TYPE = type(None)
|
|
15
15
|
|
|
@@ -33,7 +33,7 @@ def _raise(
|
|
|
33
33
|
default_message: str,
|
|
34
34
|
message: Message,
|
|
35
35
|
*args: ta.Any,
|
|
36
|
-
**kwargs: ta.Any
|
|
36
|
+
**kwargs: ta.Any,
|
|
37
37
|
) -> ta.NoReturn:
|
|
38
38
|
if _callable(message):
|
|
39
39
|
message = ta.cast(ta.Callable, message)(*args, **kwargs)
|
|
@@ -64,7 +64,7 @@ def isinstance(v: ta.Any, spec: ta.Union[type[T], tuple], msg: Message = None) -
|
|
|
64
64
|
return v
|
|
65
65
|
|
|
66
66
|
|
|
67
|
-
def of_isinstance(spec:
|
|
67
|
+
def of_isinstance(spec: type[T] | tuple, msg: Message = None) -> ta.Callable[[ta.Any], T]:
|
|
68
68
|
def inner(v):
|
|
69
69
|
return isinstance(v, _unpack_isinstance_spec(spec), msg)
|
|
70
70
|
|
|
@@ -155,7 +155,7 @@ def single(obj: ta.Iterable[T], message: Message = None) -> T:
|
|
|
155
155
|
return value
|
|
156
156
|
|
|
157
157
|
|
|
158
|
-
def optional_single(obj: ta.Iterable[T], message: Message = None) ->
|
|
158
|
+
def optional_single(obj: ta.Iterable[T], message: Message = None) -> T | None:
|
|
159
159
|
it = iter(obj)
|
|
160
160
|
try:
|
|
161
161
|
value = next(it)
|
|
@@ -176,7 +176,7 @@ def none(v: ta.Any, msg: Message = None) -> None:
|
|
|
176
176
|
_raise(ValueError, 'Must be None', msg, v)
|
|
177
177
|
|
|
178
178
|
|
|
179
|
-
def not_none(v:
|
|
179
|
+
def not_none(v: T | None, msg: Message = None) -> T:
|
|
180
180
|
if v is None:
|
|
181
181
|
_raise(ValueError, 'Must not be None', msg, v)
|
|
182
182
|
return v
|
|
@@ -212,7 +212,7 @@ def callable(v: T, msg: Message = None) -> T:
|
|
|
212
212
|
return v # type: ignore
|
|
213
213
|
|
|
214
214
|
|
|
215
|
-
def non_empty_str(v:
|
|
215
|
+
def non_empty_str(v: str | None, msg: Message = None) -> str:
|
|
216
216
|
if not _isinstance(v, str) or not v:
|
|
217
217
|
_raise(ValueError, 'Must be non-empty str', msg, v)
|
|
218
218
|
return v
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
from .coerce import ( # noqa
|
|
2
|
+
abs_set,
|
|
3
|
+
abs_set_of,
|
|
4
|
+
abs_set_of_or_none,
|
|
5
|
+
abs_set_or_none,
|
|
6
|
+
frozenset_,
|
|
7
|
+
frozenset_of,
|
|
8
|
+
frozenset_of_or_none,
|
|
9
|
+
frozenset_or_none,
|
|
10
|
+
map,
|
|
11
|
+
map_of,
|
|
12
|
+
map_of_or_none,
|
|
13
|
+
map_or_none,
|
|
14
|
+
opt_abs_set,
|
|
15
|
+
opt_abs_set_of,
|
|
16
|
+
opt_frozenset,
|
|
17
|
+
opt_frozenset_of,
|
|
18
|
+
opt_map,
|
|
19
|
+
opt_map_of,
|
|
20
|
+
opt_seq,
|
|
21
|
+
opt_seq_of,
|
|
22
|
+
seq,
|
|
23
|
+
seq_of,
|
|
24
|
+
seq_of_or_none,
|
|
25
|
+
seq_or_none,
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
from .frozen import ( # noqa
|
|
29
|
+
Frozen,
|
|
30
|
+
FrozenDict,
|
|
31
|
+
FrozenList,
|
|
32
|
+
frozendict,
|
|
33
|
+
frozenlist,
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
from .identity import ( # noqa
|
|
37
|
+
IdentityKeyDict,
|
|
38
|
+
IdentitySet,
|
|
39
|
+
IdentityWrapper,
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
from .indexed import ( # noqa
|
|
43
|
+
IndexedSeq,
|
|
44
|
+
IndexedSetSeq,
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
from .mappings import ( # noqa
|
|
48
|
+
MissingDict,
|
|
49
|
+
TypeMap,
|
|
50
|
+
TypeMultiMap,
|
|
51
|
+
guarded_map_update,
|
|
52
|
+
multikey_dict,
|
|
53
|
+
yield_dict_init,
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
from .ordered import ( # noqa
|
|
57
|
+
OrderedFrozenSet,
|
|
58
|
+
OrderedSet,
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
from .persistent import ( # noqa
|
|
62
|
+
PersistentMap,
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
from .skiplist import ( # noqa
|
|
66
|
+
SkipList,
|
|
67
|
+
SkipListDict,
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
from .sorted import ( # noqa
|
|
71
|
+
SortedCollection,
|
|
72
|
+
SortedListDict,
|
|
73
|
+
SortedMapping,
|
|
74
|
+
SortedMutableMapping,
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
from .treapmap import ( # noqa
|
|
78
|
+
new_treap_map,
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
from .unmodifiable import ( # noqa
|
|
82
|
+
Unmodifiable,
|
|
83
|
+
UnmodifiableMapping,
|
|
84
|
+
UnmodifiableSequence,
|
|
85
|
+
UnmodifiableSet,
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
from .utils import ( # noqa
|
|
89
|
+
all_equal,
|
|
90
|
+
all_not_equal,
|
|
91
|
+
indexes,
|
|
92
|
+
key_cmp,
|
|
93
|
+
mut_toposort,
|
|
94
|
+
partition,
|
|
95
|
+
toposort,
|
|
96
|
+
unique,
|
|
97
|
+
unique_dict,
|
|
98
|
+
)
|
|
@@ -27,7 +27,7 @@ class _HashedSeq(list):
|
|
|
27
27
|
def __init__(
|
|
28
28
|
self,
|
|
29
29
|
tup: ta.Tuple,
|
|
30
|
-
hasher: ta.Callable[[ta.Any], int] = hash
|
|
30
|
+
hasher: ta.Callable[[ta.Any], int] = hash,
|
|
31
31
|
) -> None:
|
|
32
32
|
super().__init__()
|
|
33
33
|
|
|
@@ -46,7 +46,7 @@ def _make_key(
|
|
|
46
46
|
fasttypes=frozenset([int, str, frozenset, type(None)]),
|
|
47
47
|
tuple=tuple,
|
|
48
48
|
type=type,
|
|
49
|
-
len=len
|
|
49
|
+
len=len,
|
|
50
50
|
) -> ta.Any:
|
|
51
51
|
key = args
|
|
52
52
|
if kwargs:
|
|
@@ -81,7 +81,7 @@ class _CacheDescriptor:
|
|
|
81
81
|
fn: ta.Callable,
|
|
82
82
|
scope: Scope,
|
|
83
83
|
typed: bool,
|
|
84
|
-
**kwargs: ta.Any
|
|
84
|
+
**kwargs: ta.Any,
|
|
85
85
|
) -> None:
|
|
86
86
|
super().__init__()
|
|
87
87
|
|
|
@@ -175,9 +175,9 @@ class _CacheDescriptor:
|
|
|
175
175
|
|
|
176
176
|
|
|
177
177
|
def cache(
|
|
178
|
-
scope:
|
|
178
|
+
scope: Scope | str = Scope.INSTANCE,
|
|
179
179
|
typed: bool = False,
|
|
180
|
-
**kwargs
|
|
180
|
+
**kwargs,
|
|
181
181
|
) -> CC:
|
|
182
182
|
if not isinstance(scope, Scope):
|
|
183
183
|
scope = getattr(Scope, scope.upper()) # noqa
|
|
@@ -82,8 +82,8 @@ class CacheImpl(Cache[K, V]):
|
|
|
82
82
|
lru_next: 'CacheImpl.Link'
|
|
83
83
|
lfu_prev: 'CacheImpl.Link'
|
|
84
84
|
lfu_next: 'CacheImpl.Link'
|
|
85
|
-
key: ta.
|
|
86
|
-
value: ta.
|
|
85
|
+
key: ta.Any | weakref.ref
|
|
86
|
+
value: ta.Any | weakref.ref
|
|
87
87
|
weight: float
|
|
88
88
|
written: float
|
|
89
89
|
accessed: float
|
|
@@ -120,7 +120,7 @@ class CacheImpl(Cache[K, V]):
|
|
|
120
120
|
identity_keys: bool = False,
|
|
121
121
|
expire_after_access: float | None = None,
|
|
122
122
|
expire_after_write: float | None = None,
|
|
123
|
-
removal_listener: ta.Callable[[
|
|
123
|
+
removal_listener: ta.Callable[[K | weakref.ref, V | weakref.ref], None] | None = None,
|
|
124
124
|
clock: ta.Callable[[], float] | None = None,
|
|
125
125
|
weak_keys: bool = False,
|
|
126
126
|
weak_values: bool = False,
|
|
@@ -165,7 +165,7 @@ class CacheImpl(Cache[K, V]):
|
|
|
165
165
|
if self._track_frequency:
|
|
166
166
|
self._root.lfu_next = self._root.lfu_prev = self._root
|
|
167
167
|
|
|
168
|
-
weak_dead: ta.
|
|
168
|
+
weak_dead: ta.Deque[CacheImpl.Link] | None
|
|
169
169
|
if weak_keys or weak_values:
|
|
170
170
|
weak_dead = collections.deque()
|
|
171
171
|
weak_dead_ref = weakref.ref(weak_dead)
|
|
@@ -39,8 +39,8 @@ def seq(
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
def opt_seq(
|
|
42
|
-
it: ta.
|
|
43
|
-
) -> ta.
|
|
42
|
+
it: ta.Iterable[T] | None,
|
|
43
|
+
) -> ta.Sequence[T] | None:
|
|
44
44
|
if it is None:
|
|
45
45
|
return None
|
|
46
46
|
else:
|
|
@@ -48,8 +48,8 @@ def opt_seq(
|
|
|
48
48
|
|
|
49
49
|
|
|
50
50
|
def seq_or_none(
|
|
51
|
-
it: ta.
|
|
52
|
-
) -> ta.
|
|
51
|
+
it: ta.Iterable[T] | None,
|
|
52
|
+
) -> ta.Sequence[T] | None:
|
|
53
53
|
ret = opt_seq(it)
|
|
54
54
|
if ret:
|
|
55
55
|
return ret
|
|
@@ -58,7 +58,7 @@ def seq_or_none(
|
|
|
58
58
|
|
|
59
59
|
|
|
60
60
|
def seq_of(
|
|
61
|
-
fn: ta.
|
|
61
|
+
fn: ta.Callable[[T], T2] | tuple,
|
|
62
62
|
) -> ta.Callable[[ta.Iterable[T]], ta.Sequence[T2]]:
|
|
63
63
|
def inner(it):
|
|
64
64
|
return seq(fn(e) for e in it) # type: ignore
|
|
@@ -68,8 +68,8 @@ def seq_of(
|
|
|
68
68
|
|
|
69
69
|
|
|
70
70
|
def opt_seq_of(
|
|
71
|
-
fn: ta.
|
|
72
|
-
) -> ta.Callable[[ta.
|
|
71
|
+
fn: ta.Callable[[T], T2] | tuple,
|
|
72
|
+
) -> ta.Callable[[ta.Iterable[T] | None], ta.Sequence[T2] | None]:
|
|
73
73
|
def inner(it):
|
|
74
74
|
if it is None:
|
|
75
75
|
return None
|
|
@@ -81,8 +81,8 @@ def opt_seq_of(
|
|
|
81
81
|
|
|
82
82
|
|
|
83
83
|
def seq_of_or_none(
|
|
84
|
-
fn: ta.
|
|
85
|
-
) -> ta.Callable[[ta.
|
|
84
|
+
fn: ta.Callable[[T], T2] | tuple,
|
|
85
|
+
) -> ta.Callable[[ta.Iterable[T] | None], ta.Sequence[T2] | None]:
|
|
86
86
|
def inner(it):
|
|
87
87
|
if it is None:
|
|
88
88
|
return None
|
|
@@ -115,8 +115,8 @@ def abs_set(
|
|
|
115
115
|
|
|
116
116
|
|
|
117
117
|
def opt_abs_set(
|
|
118
|
-
it: ta.
|
|
119
|
-
) -> ta.
|
|
118
|
+
it: ta.Iterable[T] | None,
|
|
119
|
+
) -> ta.AbstractSet[T] | None:
|
|
120
120
|
if it is None:
|
|
121
121
|
return None
|
|
122
122
|
else:
|
|
@@ -124,8 +124,8 @@ def opt_abs_set(
|
|
|
124
124
|
|
|
125
125
|
|
|
126
126
|
def abs_set_or_none(
|
|
127
|
-
it: ta.
|
|
128
|
-
) -> ta.
|
|
127
|
+
it: ta.Iterable[T] | None,
|
|
128
|
+
) -> ta.AbstractSet[T] | None:
|
|
129
129
|
ret = opt_abs_set(it)
|
|
130
130
|
if ret:
|
|
131
131
|
return ret
|
|
@@ -134,7 +134,7 @@ def abs_set_or_none(
|
|
|
134
134
|
|
|
135
135
|
|
|
136
136
|
def abs_set_of(
|
|
137
|
-
fn: ta.
|
|
137
|
+
fn: ta.Callable[[T], T2] | tuple,
|
|
138
138
|
) -> ta.Callable[[ta.Iterable[T]], ta.AbstractSet[T2]]:
|
|
139
139
|
def inner(it):
|
|
140
140
|
return abs_set(fn(e) for e in it) # type: ignore
|
|
@@ -144,8 +144,8 @@ def abs_set_of(
|
|
|
144
144
|
|
|
145
145
|
|
|
146
146
|
def opt_abs_set_of(
|
|
147
|
-
fn: ta.
|
|
148
|
-
) -> ta.Callable[[ta.
|
|
147
|
+
fn: ta.Callable[[T], T2] | tuple,
|
|
148
|
+
) -> ta.Callable[[ta.Iterable[T] | None], ta.AbstractSet[T2] | None]:
|
|
149
149
|
def inner(it):
|
|
150
150
|
if it is None:
|
|
151
151
|
return None
|
|
@@ -157,8 +157,8 @@ def opt_abs_set_of(
|
|
|
157
157
|
|
|
158
158
|
|
|
159
159
|
def abs_set_of_or_none(
|
|
160
|
-
fn: ta.
|
|
161
|
-
) -> ta.Callable[[ta.
|
|
160
|
+
fn: ta.Callable[[T], T2] | tuple,
|
|
161
|
+
) -> ta.Callable[[ta.Iterable[T] | None], ta.AbstractSet[T2] | None]:
|
|
162
162
|
def inner(it):
|
|
163
163
|
if it is None:
|
|
164
164
|
return None
|
|
@@ -191,8 +191,8 @@ def frozenset_(
|
|
|
191
191
|
|
|
192
192
|
|
|
193
193
|
def opt_frozenset(
|
|
194
|
-
it: ta.
|
|
195
|
-
) ->
|
|
194
|
+
it: ta.Iterable[T] | None,
|
|
195
|
+
) -> frozenset[T] | None:
|
|
196
196
|
if it is None:
|
|
197
197
|
return None
|
|
198
198
|
else:
|
|
@@ -200,8 +200,8 @@ def opt_frozenset(
|
|
|
200
200
|
|
|
201
201
|
|
|
202
202
|
def frozenset_or_none(
|
|
203
|
-
it: ta.
|
|
204
|
-
) ->
|
|
203
|
+
it: ta.Iterable[T] | None,
|
|
204
|
+
) -> frozenset[T] | None:
|
|
205
205
|
ret = opt_frozenset(it)
|
|
206
206
|
if ret:
|
|
207
207
|
return ret
|
|
@@ -210,7 +210,7 @@ def frozenset_or_none(
|
|
|
210
210
|
|
|
211
211
|
|
|
212
212
|
def frozenset_of(
|
|
213
|
-
fn: ta.
|
|
213
|
+
fn: ta.Callable[[T], T2] | tuple,
|
|
214
214
|
) -> ta.Callable[[ta.Iterable[T]], frozenset[T2]]:
|
|
215
215
|
def inner(it):
|
|
216
216
|
return frozenset_(fn(e) for e in it) # type: ignore
|
|
@@ -220,8 +220,8 @@ def frozenset_of(
|
|
|
220
220
|
|
|
221
221
|
|
|
222
222
|
def opt_frozenset_of(
|
|
223
|
-
fn: ta.
|
|
224
|
-
) -> ta.Callable[[ta.
|
|
223
|
+
fn: ta.Callable[[T], T2] | tuple,
|
|
224
|
+
) -> ta.Callable[[ta.Iterable[T] | None], frozenset[T2] | None]:
|
|
225
225
|
def inner(it):
|
|
226
226
|
if it is None:
|
|
227
227
|
return None
|
|
@@ -233,8 +233,8 @@ def opt_frozenset_of(
|
|
|
233
233
|
|
|
234
234
|
|
|
235
235
|
def frozenset_of_or_none(
|
|
236
|
-
fn: ta.
|
|
237
|
-
) -> ta.Callable[[ta.
|
|
236
|
+
fn: ta.Callable[[T], T2] | tuple,
|
|
237
|
+
) -> ta.Callable[[ta.Iterable[T] | None], frozenset[T2] | None]:
|
|
238
238
|
def inner(it):
|
|
239
239
|
if it is None:
|
|
240
240
|
return None
|
|
@@ -256,14 +256,14 @@ def frozenset_of_or_none(
|
|
|
256
256
|
|
|
257
257
|
|
|
258
258
|
def map(
|
|
259
|
-
src: ta.
|
|
259
|
+
src: ta.Mapping[K, V] | ta.Iterable[tuple[K, V]],
|
|
260
260
|
) -> ta.Mapping[K, V]:
|
|
261
261
|
return FrozenDict(src)
|
|
262
262
|
|
|
263
263
|
|
|
264
264
|
def opt_map(
|
|
265
|
-
src: ta.
|
|
266
|
-
) -> ta.
|
|
265
|
+
src: ta.Mapping[K, V] | ta.Iterable[tuple[K, V]] | None,
|
|
266
|
+
) -> ta.Mapping[K, V] | None:
|
|
267
267
|
if src is None:
|
|
268
268
|
return None
|
|
269
269
|
else:
|
|
@@ -271,8 +271,8 @@ def opt_map(
|
|
|
271
271
|
|
|
272
272
|
|
|
273
273
|
def map_or_none(
|
|
274
|
-
src: ta.
|
|
275
|
-
) -> ta.
|
|
274
|
+
src: ta.Mapping[K, V] | ta.Iterable[tuple[K, V]] | None,
|
|
275
|
+
) -> ta.Mapping[K, V] | None:
|
|
276
276
|
ret = opt_map(src)
|
|
277
277
|
if ret:
|
|
278
278
|
return ret
|
|
@@ -281,10 +281,10 @@ def map_or_none(
|
|
|
281
281
|
|
|
282
282
|
|
|
283
283
|
def map_of(
|
|
284
|
-
key_fn: ta.
|
|
285
|
-
value_fn: ta.
|
|
284
|
+
key_fn: ta.Callable[[K], K2] | tuple,
|
|
285
|
+
value_fn: ta.Callable[[V], V2] | tuple,
|
|
286
286
|
) -> ta.Callable[
|
|
287
|
-
[ta.
|
|
287
|
+
[ta.Mapping[K, V] | ta.Iterable[tuple[K, V]]],
|
|
288
288
|
ta.Mapping[K2, V2],
|
|
289
289
|
]:
|
|
290
290
|
def inner(src):
|
|
@@ -296,11 +296,11 @@ def map_of(
|
|
|
296
296
|
|
|
297
297
|
|
|
298
298
|
def opt_map_of(
|
|
299
|
-
key_fn: ta.
|
|
300
|
-
value_fn: ta.
|
|
299
|
+
key_fn: ta.Callable[[K], K2] | tuple,
|
|
300
|
+
value_fn: ta.Callable[[V], V2] | tuple,
|
|
301
301
|
) -> ta.Callable[
|
|
302
|
-
[ta.
|
|
303
|
-
ta.
|
|
302
|
+
[ta.Mapping[K, V] | ta.Iterable[tuple[K, V]] | None],
|
|
303
|
+
ta.Mapping[K2, V2] | None,
|
|
304
304
|
]:
|
|
305
305
|
def inner(src):
|
|
306
306
|
if src is None:
|
|
@@ -314,11 +314,11 @@ def opt_map_of(
|
|
|
314
314
|
|
|
315
315
|
|
|
316
316
|
def map_of_or_none(
|
|
317
|
-
key_fn: ta.
|
|
318
|
-
value_fn: ta.
|
|
317
|
+
key_fn: ta.Callable[[K], K2] | tuple,
|
|
318
|
+
value_fn: ta.Callable[[V], V2] | tuple,
|
|
319
319
|
) -> ta.Callable[
|
|
320
|
-
[ta.
|
|
321
|
-
ta.
|
|
320
|
+
[ta.Mapping[K, V] | ta.Iterable[tuple[K, V]] | None],
|
|
321
|
+
ta.Mapping[K2, V2] | None,
|
|
322
322
|
]:
|
|
323
323
|
def inner(src):
|
|
324
324
|
if src is None:
|