Skip to content

Commit 82c3a5a

Browse files
fixed names
1 parent fac74ed commit 82c3a5a

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ like **Overriding**
66
the class uses Type Hints for Overriding
77
sample of Overriding in python
88

9-
from addons import Override
9+
from addons import Overload
1010

11-
@Override # Always Need Type Hint
11+
@Overload # Always Need Type Hint
1212
def printer(data:str)->None:
1313
print("String Data:",data)
1414

15-
@printer.override # automate overriding using Type Hint
15+
@printer.overload # automate overriding using Type Hint
1616
def printer_int(data:int)->None:
1717
print("Integer Data:",data)
1818

19-
@printer.override_manual(float)
19+
@printer.overload_manual(float)
2020
def printer_float(data)->None:
2121
print("Float Data:",data)
2222

addons/classes.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ class Overload:
99
def __init__(self,function):
1010
self.__funcmap={}
1111
self.__default=function
12-
self.override(function)
13-
def override(self,function):
12+
self.overload(function)
13+
def overload(self,function):
1414
args = function.__annotations__.copy()
1515
args.pop("return",None)
1616
args = tuple(args.values())
1717
self.__funcmap[args] = function
1818
return function
19-
def override_manual(self,*args):
19+
def overload_manual(self,*args):
2020
args=tuple([arg.__class__ if type(arg) != type else arg for arg in args])
2121
funcmap=self.__funcmap
2222
def wrapper(function):

0 commit comments

Comments
 (0)