Skip to content

Instantly share code, notes, and snippets.

Last active Nov 20, 2016
What would you like to do?
Non-data descriptors as applied to
class VerbosityLevel(object):
def __init__(self, level):
self.level = level
def __get__(self, obj, _):
return obj.level >= self.level
class Verbosity(object):
"""Class used to determine what to print to standard output.
level: Determines what level of output to print.
def __init__(self, level=VERB_QUIET):
self.level = level
quiet = VerbosityLevel(VERB_QUIET)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment