Skip to content

Instantly share code, notes, and snippets.

View Microserf's full-sized avatar

Anthony Lalande Microserf

View GitHub Profile
@Microserf
Microserf / aging_calculator.py
Created April 22, 2017 22:05
Aging calculator
#!/usr/bin/env python3
from datetime import datetime
TARGETS = {
'Anthony': {
'dob': datetime(1982, 10, 19),
'aging_rate': 1
},
@Microserf
Microserf / function_decorator_to_method_decorator.py
Created March 14, 2017 20:01
A converter for turning a function decorator into a method decorator
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