This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from datetime import datetime | |
TARGETS = { | |
'Anthony': { | |
'dob': datetime(1982, 10, 19), | |
'aging_rate': 1 | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import functools | |
def make_method_decorator(decorator): | |
# This function returns a version of @decorator fit for wrapping a method | |
def method_wrapper(method): | |
@functools.wraps(method) | |
def inner_method(self, *args, **kwargs): | |
@decorator |