omlish 0.0.0.dev2__tar.gz → 0.0.0.dev3__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/omlish.egg-info → omlish-0.0.0.dev3}/PKG-INFO +1 -1
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/__about__.py +1 -2
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/argparse.py +4 -4
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/asyncs/__init__.py +2 -2
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/asyncs/anyio.py +13 -11
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/asyncs/asyncs.py +1 -3
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/asyncs/futures.py +10 -9
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/c3.py +1 -1
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/check.py +3 -3
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/collections/_abc.py +2 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/collections/_io_abc.py +4 -2
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/collections/cache/__init__.py +1 -1
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/collections/cache/descriptor.py +8 -8
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/collections/cache/impl.py +24 -17
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/collections/cache/types.py +1 -1
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/collections/coerce.py +1 -1
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/collections/frozen.py +6 -6
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/collections/identity.py +3 -4
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/collections/mappings.py +2 -2
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/collections/ordered.py +7 -7
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/collections/skiplist.py +1 -1
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/collections/sorted.py +1 -1
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/collections/treap.py +25 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/collections/treapmap.py +57 -5
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/collections/unmodifiable.py +9 -9
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/collections/utils.py +1 -1
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/configs/flattening.py +7 -6
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/configs/props.py +3 -3
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/dataclasses/__init__.py +1 -1
- omlish-0.0.0.dev3/omlish/dataclasses/impl/__init__.py +24 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/dataclasses/impl/api.py +10 -11
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/dataclasses/impl/as_.py +4 -4
- omlish-0.0.0.dev3/omlish/dataclasses/impl/exceptions.py +2 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/dataclasses/impl/fields.py +7 -7
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/dataclasses/impl/frozen.py +2 -2
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/dataclasses/impl/init.py +5 -5
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/dataclasses/impl/internals.py +1 -1
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/dataclasses/impl/metaclass.py +1 -1
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/dataclasses/impl/order.py +1 -1
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/dataclasses/impl/replace.py +1 -1
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/dataclasses/impl/repr.py +4 -4
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/dataclasses/impl/utils.py +6 -6
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/defs.py +13 -17
- {omlish-0.0.0.dev2/omlish → omlish-0.0.0.dev3/omlish/diag}/procfs.py +22 -24
- omlish-0.0.0.dev3/omlish/diag/ps.py +47 -0
- {omlish-0.0.0.dev2/omlish → omlish-0.0.0.dev3/omlish/diag}/replserver/console.py +18 -20
- {omlish-0.0.0.dev2/omlish → omlish-0.0.0.dev3/omlish/diag}/replserver/server.py +8 -8
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/dispatch/dispatch.py +5 -8
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/dispatch/functions.py +1 -1
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/dispatch/methods.py +4 -5
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/docker.py +1 -1
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/dynamic.py +8 -8
- omlish-0.0.0.dev3/omlish/fnpairs.py +311 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/graphs/trees.py +13 -13
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/inject/__init__.py +7 -7
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/inject/elements.py +1 -1
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/inject/exceptions.py +7 -7
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/inject/impl/elements.py +4 -4
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/inject/impl/injector.py +5 -5
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/inject/impl/inspect.py +2 -2
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/inject/impl/scopes.py +9 -9
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/inject/proxy.py +5 -5
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/iterators.py +19 -24
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/json.py +7 -6
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/lang/__init__.py +9 -4
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/lang/cached.py +2 -5
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/lang/classes/__init__.py +2 -2
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/lang/classes/abstract.py +2 -2
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/lang/classes/restrict.py +14 -14
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/lang/classes/simple.py +1 -1
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/lang/classes/virtual.py +5 -5
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/lang/clsdct.py +1 -1
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/lang/cmp.py +2 -2
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/lang/contextmanagers.py +12 -14
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/lang/descriptors.py +16 -4
- omlish-0.0.0.dev3/omlish/lang/exceptions.py +2 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/lang/functions.py +58 -22
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/lang/imports.py +22 -27
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/lang/iterables.py +2 -2
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/lang/maybes.py +1 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/lang/objects.py +15 -9
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/lang/resolving.py +1 -1
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/lang/strings.py +1 -1
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/lang/typing.py +3 -3
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/libc.py +9 -5
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/logs/_abc.py +5 -1
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/logs/filters.py +2 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/logs/formatters.py +6 -2
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/logs/utils.py +1 -1
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/marshal/base.py +3 -3
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/marshal/exceptions.py +1 -1
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/marshal/global_.py +10 -4
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/marshal/objects.py +1 -2
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/marshal/registries.py +3 -3
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/marshal/utils.py +2 -2
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/marshal/values.py +1 -1
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/math.py +9 -9
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/reflect.py +3 -3
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/runmodule.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/stats.py +4 -5
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/term.py +1 -1
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/testing/pydevd.py +26 -6
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/testing/pytest/inject/harness.py +1 -1
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/testing/pytest/plugins/pydevd.py +1 -1
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/testing/pytest/plugins/switches.py +1 -1
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/text/delimit.py +3 -6
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3/omlish.egg-info}/PKG-INFO +1 -1
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish.egg-info/SOURCES.txt +9 -11
- omlish-0.0.0.dev3/pyproject.toml +276 -0
- omlish-0.0.0.dev2/omlish/dataclasses/impl/__init__.py +0 -8
- omlish-0.0.0.dev2/omlish/dataclasses/impl/exceptions.py +0 -2
- omlish-0.0.0.dev2/omlish/lang/classes/test/test_abstract.py +0 -89
- omlish-0.0.0.dev2/omlish/lang/classes/test/test_restrict.py +0 -71
- omlish-0.0.0.dev2/omlish/lang/classes/test/test_simple.py +0 -58
- omlish-0.0.0.dev2/omlish/lang/classes/test/test_virtual.py +0 -72
- omlish-0.0.0.dev2/omlish/lang/exceptions.py +0 -2
- omlish-0.0.0.dev2/pyproject.toml +0 -200
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/LICENSE +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/MANIFEST.in +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/README.md +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/__init__.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/asyncs/asyncio.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/asyncs/trio.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/cached.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/collections/__init__.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/collections/indexed.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/collections/persistent.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/configs/__init__.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/dataclasses/impl/hashing.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/dataclasses/impl/main.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/dataclasses/impl/metadata.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/dataclasses/impl/params.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/dataclasses/impl/processing.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/dataclasses/impl/reflect.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/dataclasses/impl/simple.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/dataclasses/impl/slots.py +0 -0
- {omlish-0.0.0.dev2/omlish/graphs → omlish-0.0.0.dev3/omlish/diag}/__init__.py +0 -0
- {omlish-0.0.0.dev2/omlish → omlish-0.0.0.dev3/omlish/diag}/replserver/__init__.py +0 -0
- {omlish-0.0.0.dev2/omlish → omlish-0.0.0.dev3/omlish/diag}/replserver/__main__.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/dispatch/__init__.py +0 -0
- {omlish-0.0.0.dev2/omlish/http → omlish-0.0.0.dev3/omlish/graphs}/__init__.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/graphs/dot/__init__.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/graphs/dot/items.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/graphs/dot/rendering.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/graphs/dot/utils.py +0 -0
- {omlish-0.0.0.dev2/omlish/inject/impl → omlish-0.0.0.dev3/omlish/http}/__init__.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/http/consts.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/http/wsgi.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/inject/binder.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/inject/bindings.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/inject/eagers.py +0 -0
- {omlish-0.0.0.dev2/omlish/lang/classes/test → omlish-0.0.0.dev3/omlish/inject/impl}/__init__.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/inject/impl/bindings.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/inject/impl/private.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/inject/impl/providers.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/inject/injector.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/inject/inspect.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/inject/keys.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/inject/managed.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/inject/overrides.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/inject/private.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/inject/providers.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/inject/scopes.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/inject/types.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/lang/datetimes.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/lang/timeouts.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/logs/__init__.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/logs/configs.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/marshal/__init__.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/marshal/any.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/marshal/base64.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/marshal/dataclasses.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/marshal/datetimes.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/marshal/enums.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/marshal/factories.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/marshal/iterables.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/marshal/mappings.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/marshal/naming.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/marshal/optionals.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/marshal/polymorphism.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/marshal/primitives.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/marshal/standard.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/marshal/uuids.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/os.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/sql/__init__.py +0 -0
- /omlish-0.0.0.dev2/omlish/sql/_abcs.py → /omlish-0.0.0.dev3/omlish/sql/_abc.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/sql/dbs.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/testing/__init__.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/testing/pytest/__init__.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/testing/pytest/helpers.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/testing/pytest/inject/__init__.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/testing/pytest/plugins/__init__.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/testing/pytest/plugins/_registry.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/testing/pytest/plugins/logging.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/testing/pytest/plugins/repeat.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/testing/pytest/plugins/skips.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/testing/pytest/plugins/spacing.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/testing/testing.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/text/__init__.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/text/indent.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish/text/parts.py +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish.egg-info/dependency_links.txt +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish.egg-info/requires.txt +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/omlish.egg-info/top_level.txt +0 -0
- {omlish-0.0.0.dev2 → omlish-0.0.0.dev3}/setup.cfg +0 -0
|
@@ -164,7 +164,7 @@ class _CliMeta(type):
|
|
|
164
164
|
namespace['_parser'] = parser
|
|
165
165
|
|
|
166
166
|
subparsers = parser.add_subparsers()
|
|
167
|
-
for
|
|
167
|
+
for att, obj in objs.items():
|
|
168
168
|
if isinstance(obj, Command):
|
|
169
169
|
if obj.parent is not None:
|
|
170
170
|
raise NotImplementedError
|
|
@@ -174,14 +174,14 @@ class _CliMeta(type):
|
|
|
174
174
|
cparser.set_defaults(_cmd=obj)
|
|
175
175
|
|
|
176
176
|
elif isinstance(obj, Arg):
|
|
177
|
-
if
|
|
178
|
-
akwargs = get_arg_ann_kwargs(anns[
|
|
177
|
+
if att in anns:
|
|
178
|
+
akwargs = get_arg_ann_kwargs(anns[att])
|
|
179
179
|
obj.kwargs = {**akwargs, **obj.kwargs}
|
|
180
180
|
if not obj.dest:
|
|
181
181
|
if 'dest' in obj.kwargs:
|
|
182
182
|
obj.dest = obj.kwargs['dest']
|
|
183
183
|
else:
|
|
184
|
-
obj.dest = obj.kwargs['dest'] =
|
|
184
|
+
obj.dest = obj.kwargs['dest'] = att # type: ignore
|
|
185
185
|
parser.add_argument(*obj.args, **obj.kwargs)
|
|
186
186
|
|
|
187
187
|
else:
|
|
@@ -39,11 +39,12 @@ def split_memory_object_streams(
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
# FIXME: https://github.com/python/mypy/issues/15238
|
|
42
|
-
#
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
# FIXME: https://youtrack.jetbrains.com/issues?q=tag:%20%7BPEP%20695%7D
|
|
43
|
+
def create_memory_object_stream[T](max_buffer_size: float = 0) -> tuple[
|
|
44
|
+
anyio.streams.memory.MemoryObjectSendStream[T],
|
|
45
|
+
anyio.streams.memory.MemoryObjectReceiveStream[T],
|
|
46
|
+
]:
|
|
47
|
+
return anyio.create_memory_object_stream[T](max_buffer_size) # noqa
|
|
47
48
|
|
|
48
49
|
|
|
49
50
|
def staple_memory_object_stream(
|
|
@@ -57,12 +58,13 @@ def staple_memory_object_stream(
|
|
|
57
58
|
|
|
58
59
|
|
|
59
60
|
# FIXME: https://github.com/python/mypy/issues/15238
|
|
60
|
-
#
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
#
|
|
61
|
+
# FIXME: https://youtrack.jetbrains.com/issues?q=tag:%20%7BPEP%20695%7D
|
|
62
|
+
def staple_memory_object_stream2[T](max_buffer_size: float = 0) -> anyio.streams.stapled.StapledObjectStream[T]:
|
|
63
|
+
send, receive = anyio.create_memory_object_stream[T](max_buffer_size)
|
|
64
|
+
return anyio.streams.stapled.StapledObjectStream(
|
|
65
|
+
check.isinstance(send, anyio.streams.memory.MemoryObjectSendStream), # type: ignore
|
|
66
|
+
check.isinstance(receive, anyio.streams.memory.MemoryObjectReceiveStream), # type: ignore
|
|
67
|
+
)
|
|
66
68
|
|
|
67
69
|
|
|
68
70
|
async def gather(*fns: ta.Callable[..., ta.Awaitable[T]], take_first: bool = False) -> list[lang.Maybe[T]]:
|
|
@@ -26,10 +26,8 @@ def sync_await(fn: ta.Callable[..., T], *args, **kwargs) -> T:
|
|
|
26
26
|
|
|
27
27
|
cr = gate()
|
|
28
28
|
with contextlib.closing(cr):
|
|
29
|
-
|
|
29
|
+
with contextlib.suppress(StopIteration):
|
|
30
30
|
cr.send(None)
|
|
31
|
-
except StopIteration:
|
|
32
|
-
pass
|
|
33
31
|
if ret is missing or cr.cr_await is not None or cr.cr_running:
|
|
34
32
|
raise TypeError('Not terminated')
|
|
35
33
|
|
|
@@ -5,12 +5,13 @@ import typing as ta
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
T = ta.TypeVar('T')
|
|
8
|
+
P = ta.ParamSpec('P')
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
##
|
|
11
12
|
|
|
12
13
|
|
|
13
|
-
class
|
|
14
|
+
class FutureError(Exception, ta.Generic[T]):
|
|
14
15
|
|
|
15
16
|
def __init__(self, future: cf.Future, target: T | None = None) -> None:
|
|
16
17
|
super().__init__()
|
|
@@ -37,7 +38,7 @@ class FutureException(Exception, ta.Generic[T]):
|
|
|
37
38
|
__str__ = __repr__
|
|
38
39
|
|
|
39
40
|
|
|
40
|
-
class
|
|
41
|
+
class FutureTimeoutError(Exception):
|
|
41
42
|
pass
|
|
42
43
|
|
|
43
44
|
|
|
@@ -61,14 +62,14 @@ def wait_futures(
|
|
|
61
62
|
if cancel_on_exception:
|
|
62
63
|
for cancel_fut in not_done:
|
|
63
64
|
cancel_fut.cancel()
|
|
64
|
-
raise
|
|
65
|
+
raise FutureError(fut) from fut.exception()
|
|
65
66
|
|
|
66
67
|
not_done -= done
|
|
67
68
|
if not not_done:
|
|
68
69
|
return True
|
|
69
70
|
|
|
70
71
|
if time.time() >= (start + timeout_s):
|
|
71
|
-
raise
|
|
72
|
+
raise FutureTimeoutError
|
|
72
73
|
time.sleep(tick_interval_s)
|
|
73
74
|
|
|
74
75
|
return False
|
|
@@ -91,7 +92,7 @@ def wait_dependent_futures(
|
|
|
91
92
|
if fn in dependency_sets_by_fn[dep]:
|
|
92
93
|
raise Exception(f'Cyclic dependencies: {fn} <-> {dep}', fn, dep)
|
|
93
94
|
|
|
94
|
-
dependent_sets_by_fn:
|
|
95
|
+
dependent_sets_by_fn: dict[ta.Callable, set[ta.Callable]] = {fn: set() for fn in dependency_sets_by_fn}
|
|
95
96
|
for fn, deps in dependency_sets_by_fn.items():
|
|
96
97
|
for dep in deps:
|
|
97
98
|
dependent_sets_by_fn[dep].add(fn)
|
|
@@ -114,7 +115,7 @@ def wait_dependent_futures(
|
|
|
114
115
|
for fut in done:
|
|
115
116
|
if fut.exception():
|
|
116
117
|
cancel()
|
|
117
|
-
raise
|
|
118
|
+
raise FutureError(fut) from fut.exception()
|
|
118
119
|
|
|
119
120
|
fn = fns_by_fut[fut]
|
|
120
121
|
for dependent_fn in dependent_sets_by_fn.get(fn, set()):
|
|
@@ -128,11 +129,11 @@ def wait_dependent_futures(
|
|
|
128
129
|
|
|
129
130
|
if time.time() >= (start + timeout_s):
|
|
130
131
|
cancel()
|
|
131
|
-
raise
|
|
132
|
+
raise FutureTimeoutError
|
|
132
133
|
|
|
133
134
|
remaining_fns = {fn: deps for fn, deps in remaining_dep_sets_by_fn.items() if deps}
|
|
134
135
|
if remaining_fns:
|
|
135
|
-
raise Exception(f
|
|
136
|
+
raise Exception(f'Unfinished fns: {remaining_fns}', remaining_fns)
|
|
136
137
|
|
|
137
138
|
futs_by_fn = {fn: fut for fut, fn in fns_by_fut.items()}
|
|
138
139
|
return futs_by_fn
|
|
@@ -147,7 +148,7 @@ class ImmediateExecutor(cf.Executor):
|
|
|
147
148
|
super().__init__()
|
|
148
149
|
self._immediate_exceptions = immediate_exceptions
|
|
149
150
|
|
|
150
|
-
def submit(self, fn, *args, **kwargs):
|
|
151
|
+
def submit(self, fn: ta.Callable[P, T], /, *args: P.args, **kwargs: P.kwargs) -> cf.Future[T]:
|
|
151
152
|
future: ta.Any = cf.Future()
|
|
152
153
|
try:
|
|
153
154
|
result = fn(*args, **kwargs)
|
|
@@ -113,7 +113,7 @@ def mro(
|
|
|
113
113
|
abstract_c3_mros = [mro(base, abcs=abcs, get_bases=get_bases, is_subclass=is_subclass) for base in abstract_bases]
|
|
114
114
|
other_c3_mros = [mro(base, abcs=abcs, get_bases=get_bases, is_subclass=is_subclass) for base in other_bases]
|
|
115
115
|
return merge(
|
|
116
|
-
[[cls]] +
|
|
116
|
+
[[cls]] + # noqa
|
|
117
117
|
explicit_c3_mros + abstract_c3_mros + other_c3_mros +
|
|
118
118
|
[explicit_bases] + [abstract_bases] + [other_bases],
|
|
119
119
|
)
|
|
@@ -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 =
|
|
12
|
+
Message = str | ta.Callable[..., str | None] | None
|
|
13
13
|
|
|
14
14
|
_NONE_TYPE = type(None)
|
|
15
15
|
|
|
@@ -52,7 +52,7 @@ def _unpack_isinstance_spec(spec: ta.Any) -> tuple:
|
|
|
52
52
|
if not _isinstance(spec, tuple):
|
|
53
53
|
spec = (spec,)
|
|
54
54
|
if None in spec:
|
|
55
|
-
spec = tuple(filter(None, spec)) + (_NONE_TYPE,)
|
|
55
|
+
spec = tuple(filter(None, spec)) + (_NONE_TYPE,) # noqa
|
|
56
56
|
if ta.Any in spec:
|
|
57
57
|
spec = (object,)
|
|
58
58
|
return spec
|
|
@@ -206,7 +206,7 @@ def is_not(v: T, *os: ta.Any, msg: Message = None) -> T:
|
|
|
206
206
|
return v
|
|
207
207
|
|
|
208
208
|
|
|
209
|
-
def callable(v: T, msg: Message = None) -> T:
|
|
209
|
+
def callable(v: T, msg: Message = None) -> T: # noqa
|
|
210
210
|
if not _callable(v):
|
|
211
211
|
_raise(TypeError, 'Must be callable', msg, v)
|
|
212
212
|
return v # type: ignore
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# ruff: noqa: ANN204
|
|
2
|
+
|
|
1
3
|
class IOBase:
|
|
2
4
|
def seek(self, pos, whence=0): ...
|
|
3
5
|
|
|
@@ -16,7 +18,7 @@ class IOBase:
|
|
|
16
18
|
def writable(self): ...
|
|
17
19
|
|
|
18
20
|
@property
|
|
19
|
-
def closed(self): ...
|
|
21
|
+
def closed(self): ... # noqa
|
|
20
22
|
|
|
21
23
|
def __enter__(self): ...
|
|
22
24
|
|
|
@@ -64,7 +66,7 @@ class TextIOBase(IOBase):
|
|
|
64
66
|
|
|
65
67
|
def truncate(self, pos=None): ...
|
|
66
68
|
|
|
67
|
-
def readline(self): ...
|
|
69
|
+
def readline(self, size=-1): ...
|
|
68
70
|
|
|
69
71
|
def detach(self): ...
|
|
70
72
|
|
|
@@ -26,7 +26,7 @@ class _HashedSeq(list):
|
|
|
26
26
|
|
|
27
27
|
def __init__(
|
|
28
28
|
self,
|
|
29
|
-
tup:
|
|
29
|
+
tup: tuple,
|
|
30
30
|
hasher: ta.Callable[[ta.Any], int] = hash,
|
|
31
31
|
) -> None:
|
|
32
32
|
super().__init__()
|
|
@@ -34,19 +34,19 @@ class _HashedSeq(list):
|
|
|
34
34
|
self[:] = tup
|
|
35
35
|
self.hash_value = hasher(tup)
|
|
36
36
|
|
|
37
|
-
def __hash__(self):
|
|
37
|
+
def __hash__(self) -> int: # type: ignore
|
|
38
38
|
return self.hash_value
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
def _make_key(
|
|
42
|
-
args:
|
|
43
|
-
kwargs:
|
|
42
|
+
args: tuple,
|
|
43
|
+
kwargs: dict[str, ta.Any],
|
|
44
44
|
typed: bool,
|
|
45
45
|
kwd_mark=(object(),),
|
|
46
46
|
fasttypes=frozenset([int, str, frozenset, type(None)]),
|
|
47
|
-
tuple=tuple,
|
|
48
|
-
type=type,
|
|
49
|
-
len=len,
|
|
47
|
+
tuple=tuple, # noqa
|
|
48
|
+
type=type, # noqa
|
|
49
|
+
len=len, # noqa
|
|
50
50
|
) -> ta.Any:
|
|
51
51
|
key = args
|
|
52
52
|
if kwargs:
|
|
@@ -109,7 +109,7 @@ class _CacheDescriptor:
|
|
|
109
109
|
def _build(self, fn: ta.Callable, cache: Cache):
|
|
110
110
|
def miss(key, result):
|
|
111
111
|
if isinstance(result, Ignore):
|
|
112
|
-
return result._value
|
|
112
|
+
return result._value # noqa
|
|
113
113
|
else:
|
|
114
114
|
cache[key] = result
|
|
115
115
|
return result
|
|
@@ -8,6 +8,7 @@ TODO:
|
|
|
8
8
|
- further cythonize hot path?
|
|
9
9
|
"""
|
|
10
10
|
import collections
|
|
11
|
+
import contextlib
|
|
11
12
|
import functools
|
|
12
13
|
import logging
|
|
13
14
|
import time
|
|
@@ -17,7 +18,7 @@ import weakref
|
|
|
17
18
|
from ... import lang
|
|
18
19
|
from .types import Cache
|
|
19
20
|
from .types import Eviction
|
|
20
|
-
from .types import
|
|
21
|
+
from .types import OverweightError
|
|
21
22
|
|
|
22
23
|
|
|
23
24
|
K = ta.TypeVar('K')
|
|
@@ -33,15 +34,15 @@ class SKIP(lang.Marker):
|
|
|
33
34
|
pass
|
|
34
35
|
|
|
35
36
|
|
|
36
|
-
def LRU(cache: 'Cache') -> None:
|
|
37
|
+
def LRU(cache: 'Cache') -> None: # noqa
|
|
37
38
|
cache._kill(cache._root.lru_next) # type: ignore # noqa
|
|
38
39
|
|
|
39
40
|
|
|
40
|
-
def LRI(cache: 'Cache') -> None:
|
|
41
|
+
def LRI(cache: 'Cache') -> None: # noqa
|
|
41
42
|
cache._kill(cache._root.ins_next) # type: ignore # noqa
|
|
42
43
|
|
|
43
44
|
|
|
44
|
-
def LFU(cache: 'Cache') -> None:
|
|
45
|
+
def LFU(cache: 'Cache') -> None: # noqa
|
|
45
46
|
cache._kill(cache._root.lfu_prev) # type: ignore # noqa
|
|
46
47
|
|
|
47
48
|
|
|
@@ -92,7 +93,7 @@ class CacheImpl(Cache[K, V]):
|
|
|
92
93
|
|
|
93
94
|
def __repr__(self) -> str:
|
|
94
95
|
return (
|
|
95
|
-
f'Link@{
|
|
96
|
+
f'Link@{self.seq!s}('
|
|
96
97
|
f'ins_prev={("@" + str(self.ins_prev.seq)) if self.ins_prev is not None else None}, '
|
|
97
98
|
f'ins_next={("@" + str(self.ins_next.seq)) if self.ins_next is not None else None}, '
|
|
98
99
|
f'lru_prev={("@" + str(self.lru_prev.seq)) if self.lru_prev is not None else None}, '
|
|
@@ -165,7 +166,7 @@ class CacheImpl(Cache[K, V]):
|
|
|
165
166
|
if self._track_frequency:
|
|
166
167
|
self._root.lfu_next = self._root.lfu_prev = self._root
|
|
167
168
|
|
|
168
|
-
weak_dead:
|
|
169
|
+
weak_dead: collections.deque[CacheImpl.Link] | None
|
|
169
170
|
if weak_keys or weak_values:
|
|
170
171
|
weak_dead = collections.deque()
|
|
171
172
|
weak_dead_ref = weakref.ref(weak_dead)
|
|
@@ -276,10 +277,8 @@ class CacheImpl(Cache[K, V]):
|
|
|
276
277
|
raise Exception
|
|
277
278
|
|
|
278
279
|
def fail():
|
|
279
|
-
|
|
280
|
+
with contextlib.suppress(KeyError):
|
|
280
281
|
del self._cache[cache_key]
|
|
281
|
-
except KeyError:
|
|
282
|
-
pass
|
|
283
282
|
self._unlink(link)
|
|
284
283
|
raise KeyError(key)
|
|
285
284
|
|
|
@@ -309,7 +308,7 @@ class CacheImpl(Cache[K, V]):
|
|
|
309
308
|
link, value = self._get_link(key)
|
|
310
309
|
except KeyError:
|
|
311
310
|
self._misses += 1
|
|
312
|
-
raise KeyError(key)
|
|
311
|
+
raise KeyError(key) from None
|
|
313
312
|
|
|
314
313
|
if link.lru_next is not self._root:
|
|
315
314
|
link.lru_prev.lru_next = link.lru_next
|
|
@@ -340,7 +339,7 @@ class CacheImpl(Cache[K, V]):
|
|
|
340
339
|
return value
|
|
341
340
|
|
|
342
341
|
@staticmethod
|
|
343
|
-
def _weak_die(dead_ref: weakref.ref, link: Link, key_ref: weakref.ref) -> None:
|
|
342
|
+
def _weak_die(dead_ref: weakref.ref, link: Link, key_ref: weakref.ref) -> None: # noqa
|
|
344
343
|
dead = dead_ref()
|
|
345
344
|
if dead is not None:
|
|
346
345
|
dead.append(link)
|
|
@@ -372,7 +371,7 @@ class CacheImpl(Cache[K, V]):
|
|
|
372
371
|
|
|
373
372
|
if self._max_weight is not None and weight > self._max_weight:
|
|
374
373
|
if self._raise_overweight:
|
|
375
|
-
raise
|
|
374
|
+
raise OverweightError
|
|
376
375
|
else:
|
|
377
376
|
return
|
|
378
377
|
|
|
@@ -387,10 +386,18 @@ class CacheImpl(Cache[K, V]):
|
|
|
387
386
|
self._eviction(self)
|
|
388
387
|
|
|
389
388
|
link = CacheImpl.Link()
|
|
389
|
+
|
|
390
390
|
self._seq += 1
|
|
391
391
|
link.seq = self._seq
|
|
392
|
-
|
|
393
|
-
|
|
392
|
+
|
|
393
|
+
def make_ref(o, b):
|
|
394
|
+
if not b:
|
|
395
|
+
return o
|
|
396
|
+
return weakref.ref(o, functools.partial(CacheImpl._weak_die, self._weak_dead_ref, link)) # type: ignore # noqa
|
|
397
|
+
|
|
398
|
+
link.key = make_ref(key, self._weak_keys)
|
|
399
|
+
link.value = make_ref(value, self._weak_values)
|
|
400
|
+
|
|
394
401
|
link.weight = weight
|
|
395
402
|
link.written = link.accessed = self._clock()
|
|
396
403
|
link.hits = 0
|
|
@@ -463,10 +470,10 @@ class CacheImpl(Cache[K, V]):
|
|
|
463
470
|
else:
|
|
464
471
|
yield key # type: ignore
|
|
465
472
|
|
|
466
|
-
|
|
467
|
-
if
|
|
473
|
+
nxt = link.ins_prev
|
|
474
|
+
if nxt is link:
|
|
468
475
|
raise ValueError
|
|
469
|
-
link =
|
|
476
|
+
link = nxt
|
|
470
477
|
|
|
471
478
|
@property
|
|
472
479
|
def stats(self) -> Cache.Stats:
|
|
@@ -17,7 +17,7 @@ class Frozen(ta.Hashable, abc.ABC):
|
|
|
17
17
|
|
|
18
18
|
class FrozenDict(ta.Mapping[K, V], Frozen):
|
|
19
19
|
|
|
20
|
-
def __new__(cls, *args, **kwargs) -> 'FrozenDict[K, V]':
|
|
20
|
+
def __new__(cls, *args: ta.Any, **kwargs: ta.Any) -> 'FrozenDict[K, V]': # noqa
|
|
21
21
|
if len(args) == 1 and Frozen in type(args[0]).__bases__:
|
|
22
22
|
return args[0]
|
|
23
23
|
return super().__new__(cls)
|
|
@@ -35,10 +35,10 @@ class FrozenDict(ta.Mapping[K, V], Frozen):
|
|
|
35
35
|
return dict(self._dct)
|
|
36
36
|
|
|
37
37
|
def __repr__(self) -> str:
|
|
38
|
-
return '(
|
|
38
|
+
return f'({self._dct!r})'
|
|
39
39
|
|
|
40
40
|
def __eq__(self, other) -> bool:
|
|
41
|
-
return type(self)
|
|
41
|
+
return type(self) is type(other) and self._dct == other._dct
|
|
42
42
|
|
|
43
43
|
def __getitem__(self, key: K) -> V:
|
|
44
44
|
return self._dct[key]
|
|
@@ -63,11 +63,11 @@ class FrozenDict(ta.Mapping[K, V], Frozen):
|
|
|
63
63
|
def __setstate__(self, t):
|
|
64
64
|
self.__init__(t) # type: ignore
|
|
65
65
|
|
|
66
|
-
def drop(self, *keys):
|
|
66
|
+
def drop(self, *keys: T) -> 'FrozenDict[K, V]':
|
|
67
67
|
ks = frozenset(keys)
|
|
68
68
|
return type(self)((k, self[k]) for k in self if k not in ks)
|
|
69
69
|
|
|
70
|
-
def set(self, *args, **kwargs):
|
|
70
|
+
def set(self, *args: ta.Any, **kwargs: ta.Any) -> 'FrozenDict[K, V]':
|
|
71
71
|
new = type(self)(*args, **kwargs)
|
|
72
72
|
return type(self)(itertools.chain(self.items(), new.items()))
|
|
73
73
|
|
|
@@ -85,7 +85,7 @@ class FrozenList(ta.Sequence[T], Frozen):
|
|
|
85
85
|
return list(self)
|
|
86
86
|
|
|
87
87
|
def __repr__(self) -> str:
|
|
88
|
-
return '([
|
|
88
|
+
return f'([{", ".join(map(repr, self._tup))}])'
|
|
89
89
|
|
|
90
90
|
def __add__(self, o) -> 'FrozenList[T]':
|
|
91
91
|
if isinstance(o, FrozenList):
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import contextlib
|
|
1
2
|
import operator as op
|
|
2
3
|
import typing as ta
|
|
3
4
|
|
|
@@ -63,7 +64,7 @@ class IdentityKeyDict(ta.MutableMapping[K, V]):
|
|
|
63
64
|
def __iter__(self) -> ta.Iterator[K]:
|
|
64
65
|
return iter(map(op.itemgetter(0), self._dict.values()))
|
|
65
66
|
|
|
66
|
-
def clear(self):
|
|
67
|
+
def clear(self) -> None:
|
|
67
68
|
self._dict.clear()
|
|
68
69
|
|
|
69
70
|
|
|
@@ -87,10 +88,8 @@ class IdentitySet(ta.MutableSet[T]):
|
|
|
87
88
|
self._dict[id(item)] = item
|
|
88
89
|
|
|
89
90
|
def discard(self, item: T) -> None:
|
|
90
|
-
|
|
91
|
+
with contextlib.suppress(KeyError):
|
|
91
92
|
del self._dict[id(item)]
|
|
92
|
-
except KeyError:
|
|
93
|
-
pass
|
|
94
93
|
|
|
95
94
|
def update(self, items: ta.Iterable[T]) -> None:
|
|
96
95
|
for item in items:
|
|
@@ -68,7 +68,7 @@ class TypeMap(ta.Generic[T]):
|
|
|
68
68
|
def __len__(self) -> int:
|
|
69
69
|
return len(self._items)
|
|
70
70
|
|
|
71
|
-
def __iter__(self) -> ta.
|
|
71
|
+
def __iter__(self) -> ta.Iterator[T]:
|
|
72
72
|
return iter(self._items)
|
|
73
73
|
|
|
74
74
|
def get(self, ty: type[T]) -> T | None:
|
|
@@ -99,7 +99,7 @@ class TypeMultiMap(ta.Generic[V]):
|
|
|
99
99
|
def __len__(self) -> int:
|
|
100
100
|
return len(self._items)
|
|
101
101
|
|
|
102
|
-
def __iter__(self) -> ta.
|
|
102
|
+
def __iter__(self) -> ta.Iterator[V]:
|
|
103
103
|
return iter(self._items)
|
|
104
104
|
|
|
105
105
|
def __getitem__(self, ty: type[T]) -> ta.Sequence[T]:
|
|
@@ -37,17 +37,17 @@ class OrderedSet(ta.MutableSet[T]):
|
|
|
37
37
|
def __reversed__(self):
|
|
38
38
|
return reversed(self._dct.keys())
|
|
39
39
|
|
|
40
|
-
def pop(self, last=True):
|
|
40
|
+
def pop(self, last: bool = True) -> T:
|
|
41
41
|
if not self:
|
|
42
42
|
raise KeyError('set is empty')
|
|
43
43
|
item = next(reversed(self._dct.keys()))
|
|
44
44
|
self.discard(item)
|
|
45
45
|
return item
|
|
46
46
|
|
|
47
|
-
def __repr__(self):
|
|
47
|
+
def __repr__(self) -> str:
|
|
48
48
|
if not self:
|
|
49
|
-
return '
|
|
50
|
-
return '
|
|
49
|
+
return f'{self.__class__.__name__}()'
|
|
50
|
+
return f'{self.__class__.__name__}({list(self)!r})'
|
|
51
51
|
|
|
52
52
|
def __eq__(self, other) -> bool:
|
|
53
53
|
if isinstance(other, OrderedSet):
|
|
@@ -55,11 +55,11 @@ class OrderedSet(ta.MutableSet[T]):
|
|
|
55
55
|
return set(self) == set(other)
|
|
56
56
|
|
|
57
57
|
|
|
58
|
-
class OrderedFrozenSet(ta.FrozenSet[T]):
|
|
58
|
+
class OrderedFrozenSet(ta.FrozenSet[T]): # noqa
|
|
59
59
|
|
|
60
60
|
_list: ta.Sequence[T]
|
|
61
61
|
|
|
62
|
-
def __new__(cls, items: ta.Iterable[T]) ->
|
|
62
|
+
def __new__(cls, items: ta.Iterable[T]) -> frozenset[T]: # type: ignore
|
|
63
63
|
item_set = set()
|
|
64
64
|
item_list = []
|
|
65
65
|
for item in items:
|
|
@@ -76,6 +76,6 @@ class OrderedFrozenSet(ta.FrozenSet[T]):
|
|
|
76
76
|
def __iter__(self) -> ta.Iterator[T]:
|
|
77
77
|
return iter(self._list)
|
|
78
78
|
|
|
79
|
-
def __sub__(self, other: ta.Iterable[T]) ->
|
|
79
|
+
def __sub__(self, other: ta.Iterable[T]) -> frozenset[T]:
|
|
80
80
|
s = set(other)
|
|
81
81
|
return type(self)(i for i in self if i not in s)
|
|
@@ -190,4 +190,4 @@ class SkipList(SortedCollection[T]):
|
|
|
190
190
|
class SkipListDict(SortedListDict[K, V]):
|
|
191
191
|
|
|
192
192
|
def __init__(self, *args, **kwargs) -> None:
|
|
193
|
-
super().__init__(SkipList(comparator=SortedListDict._item_comparator), *args, **kwargs)
|
|
193
|
+
super().__init__(SkipList(comparator=SortedListDict._item_comparator), *args, **kwargs) # noqa
|
|
@@ -110,7 +110,7 @@ class SortedListDict(SortedMutableMapping[K, V]):
|
|
|
110
110
|
return len(self._impl)
|
|
111
111
|
|
|
112
112
|
def __iter__(self) -> ta.Iterator[K]:
|
|
113
|
-
for k,
|
|
113
|
+
for k, _ in self._impl:
|
|
114
114
|
yield k
|
|
115
115
|
|
|
116
116
|
def items(self) -> ta.Iterator[tuple[K, V]]: # type: ignore
|
|
@@ -16,6 +16,8 @@ WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEM
|
|
|
16
16
|
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
17
17
|
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
18
18
|
"""
|
|
19
|
+
# ruff: noqa: SLF001
|
|
20
|
+
|
|
19
21
|
import typing as ta
|
|
20
22
|
|
|
21
23
|
|
|
@@ -41,6 +43,9 @@ class TreapNode(ta.Generic[T]):
|
|
|
41
43
|
self._left = _left
|
|
42
44
|
self._right = _right
|
|
43
45
|
|
|
46
|
+
def __repr__(self) -> str:
|
|
47
|
+
return f'TreapNode(value={self._value!r}, priority={self._priority!r})'
|
|
48
|
+
|
|
44
49
|
@property
|
|
45
50
|
def value(self) -> T:
|
|
46
51
|
return self._value
|
|
@@ -78,6 +83,26 @@ def find(n: TreapNode[T] | None, v: T, c: Comparer[T]) -> TreapNode[T] | None:
|
|
|
78
83
|
n = n._left # noqa
|
|
79
84
|
|
|
80
85
|
|
|
86
|
+
def place(n: TreapNode[T] | None, v: T, c: Comparer[T], *, desc: bool = False) -> list[TreapNode[T]]:
|
|
87
|
+
ret: list[TreapNode[T]] = []
|
|
88
|
+
while True:
|
|
89
|
+
if n is None:
|
|
90
|
+
break
|
|
91
|
+
diff = c(n._value, v) # noqa
|
|
92
|
+
if diff == 0:
|
|
93
|
+
ret.append(n)
|
|
94
|
+
break
|
|
95
|
+
elif diff < 0:
|
|
96
|
+
if desc:
|
|
97
|
+
ret.append(n)
|
|
98
|
+
n = n._right # noqa
|
|
99
|
+
else:
|
|
100
|
+
if not desc:
|
|
101
|
+
ret.append(n)
|
|
102
|
+
n = n._left # noqa
|
|
103
|
+
return ret
|
|
104
|
+
|
|
105
|
+
|
|
81
106
|
def union(
|
|
82
107
|
n: TreapNode[T] | None,
|
|
83
108
|
other: TreapNode[T] | None,
|