Skip to content

Instantly share code, notes, and snippets.

@frenchtoast747
frenchtoast747 / decorator.py
Last active July 4, 2019 17:13
A Python decorator that preserves everything about the original function being decorated.
import types
class decorator(object):
"""
When using a decorator, the function that is being decorated
loses its __name__, docstring, and signature.
For example, consider the generic decorator ``my_decorator``:
def my_decorator(fn):