Skip to content

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

License

Notifications You must be signed in to change notification settings

koolmonke/extends

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages