Skip to main content

Supports runtime key-path recording/accessing for Python.

Project description

Python Key-path

Supports runtime key-path recording/accessing for Python.

from __future__ import annotations

from runtime_keypath import KeyPath, KeyPathSupporting

class A(KeyPathSupporting):
    def __init__(self) -> None:
        self.__b = B()

    @property
    def b(self) -> B:
        return self.__b

class B(KeyPathSupporting):
    def __init__(self) -> None:
        self.__c = C()

    @property
    def c(self) -> C:
        return self.__c

class C:
    pass

a = A()
key_path = KeyPath.of(a.b.c)
assert key_path.target is a and key_path.keys == ("b", "c")
assert key_path() is a.b.c

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

runtime_keypath-0.1.7.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

runtime_keypath-0.1.7-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file runtime_keypath-0.1.7.tar.gz.

File metadata

  • Download URL: runtime_keypath-0.1.7.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for runtime_keypath-0.1.7.tar.gz
Algorithm Hash digest
SHA256 fffb4b6f304df4c22f775151202806134a01aaf3d7f297f71183fb0167b574aa
MD5 35ac2b6f244656228777c9a08abe837f
BLAKE2b-256 fb2ab1b4ed4c8bb5f6b40895ebc9eb093374acd8daafcbbfd339651b2fa252ee

See more details on using hashes here.

Provenance

The following attestation bundles were made for runtime_keypath-0.1.7.tar.gz:

Publisher: python-publish.yml on Azureblade3808/py-runtime-keypath

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file runtime_keypath-0.1.7-py3-none-any.whl.

File metadata

File hashes

Hashes for runtime_keypath-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 b83fb4031cfa219da2148375822bd5da278ef8a6d77ce48184ab4d2b8547f5a7
MD5 f77ceae097ed386f1af20efbdf70fc80
BLAKE2b-256 e1fb3fa91822ede0d9ebd3284c89a86d5315cd08258126ab0bf55966568076b3

See more details on using hashes here.

Provenance

The following attestation bundles were made for runtime_keypath-0.1.7-py3-none-any.whl:

Publisher: python-publish.yml on Azureblade3808/py-runtime-keypath

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page