People debugger

A prod of a Monday morning idle brain. It goes like this:

from interfaces import IMakeSense

def getSense(person):
    """ Simple people debug tool """
    if IMakeSense.providedBy(person):
        return person.name
    else:
        return None

This can be useful in combination with a default method, something like:

def Default(person):
    alsoProvides(person, IMakeNonsense)
    return True

0 Response to “People debugger”


  • No Comments

Leave a Reply