Skip to main content

empower

Goodbye Inheritance!!!

Install

pip install empower

Usage

You have a Duck class without any methods.

# mod/__init__.py

class Duck:
    ...

You define a trait Fly for Duck

# mod/fly.py

from empower import impl, Trait

from . import Duck

@impl(Duck)
class Fly(Trait):
    def fly(self):
        return "fly"

And you define another trait Run for Duck

# mod/run.py

from empower import impl, Trait

from . import Duck


@impl(Duck)
class Run(Trait):
    def run(self):
        return "run"

Now you can add empower Duck

# main.py

from mod import Duck
from empower import use

duck = Duck()

use("mod.fly")  # load fly trait
use("mod.run")  # load run trait

assert duck.fly() == "fly"
assert duck.run() == "run"

Metadata

Release files for empower 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for empower 0.2.1
File Size Uploaded Provenance Actions
empower-0.2.1.tar.gz 6.9 kB Without provenance Details for empower-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for empower 0.2.1
File Interpreter ABI Platform Actions
empower-0.2.1-py3-none-any.whl Python 3 none any Details for empower-0.2.1-py3-none-any.whl

Total release size: 14.2 kB

Release files / empower-0.2.1.tar.gz

Download URL empower-0.2.1.tar.gz
Size 6.9 kB
Tags Source
SHA-256 checksum
How to use checksums
c9b16d0bd38c8aadc80db74c50ae5c9069454460f843c091ed25bd0004ec71a1
BLAKE2b-256 checksum
How to use checksums
18b5b7d4baabf40593f6383527ca44e304f6750d07402cf19567f665cfaf27c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.14 CPython/3.7.12 Darwin/21.3.0

Release files / empower-0.2.1-py3-none-any.whl

Download URL empower-0.2.1-py3-none-any.whl
Size 7.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2e3f2810e78aec272d888fd0f48dee4ada93398f9a84d5a3fb31ce2b8281aca9
BLAKE2b-256 checksum
How to use checksums
38c45ca23d160eff0ad6ee0e41c1ab41843a6a0965755c9c6b0dbf81523df3ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.14 CPython/3.7.12 Darwin/21.3.0

Security for empower 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page