Skip to main content

extends

A simple Python library that adds a decorator which helps extend functionality of classes by new methods without inheriting them

Example

from dataclasses import dataclass
from typing import List
from extends import extends


@dataclass
class Student:
    name: str
    marks: List[int]


@extends(Student)
def avg(self: Student) -> float:
    return sum(self.marks) / len(self.marks)

Metadata

Release files for extends 0.3.0

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

Source distribution (sdist)

Source distribution for extends 0.3.0
File Size Uploaded
extends-0.3.0.tar.gz 2.4 kB Details

Built distribution (wheel)

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

Total release size: 4.9 kB

Release files / extends-0.3.0.tar.gz

Download URL extends-0.3.0.tar.gz
Size 2.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4b7a5bd1476b0ef1c541decc1b90407e9315548eb11c8aea987eba69d123b5cc
BLAKE2b-256 checksum
How to use checksums
d9f80203dd66cd49021e7817c01977290e87314bf42ebcc1507cff2c076fef01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.2 CPython/3.8.0 Windows/10

Release files / extends-0.3.0-py3-none-any.whl

Download URL extends-0.3.0-py3-none-any.whl
Size 2.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b98319e21217d128c1ec4a935579c0cde429f2de7774bafdbc528b3d01314f29
BLAKE2b-256 checksum
How to use checksums
91a8ee3b075a3cde69bd55f7679641d668321af669842f767c6092e4ddf14335
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.2 CPython/3.8.0 Windows/10

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.1.0

2 release files

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