Initial commit

This commit is contained in:
David Beazley
2023-07-16 20:21:00 -05:00
parent 82e815fab2
commit 7d4b30154a
259 changed files with 600233 additions and 2 deletions

21
Solutions/7_2/logcall.py Normal file
View File

@@ -0,0 +1,21 @@
# logcall.py
from functools import wraps
def logformat(fmt):
def logged(func):
print('Adding logging to', func.__name__)
@wraps(func)
def wrapper(*args,**kwargs):
print(fmt.format(func=func))
return func(*args, **kwargs)
return wrapper
return logged
# Original no-argument @logged decorator defined in terms of the more
# general @logformat decorator
logged = logformat('Calling {func.__name__}')