Skip to content

Instantly share code, notes, and snippets.

View antvconst's full-sized avatar

Anton Konstantinov antvconst

  • Russia, Saint-Petersburg
View GitHub Profile
import functools
def contextmanager(function):
@functools.wraps(function)
def contextmanager_impl(*args, **kwargs):
class contextmanager_impl_(object):
def __init__(self):
self.gen = function(*args, **kwargs)
self.it = None
import functools
class classmethod(object):
def __init__(self, f):
self.f = f
def __get__(self, owner, owner_type):
@functools.wraps(self.f)
def wrapper(*args, **kwargs):
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.