abo-abo/lpy

Can not eval decorated function or class in place

QiangF opened this issue · 0 comments

For example(point before @):

def honirific(cls):
    class HonirificCls(cls):
        def full_name(self):
            return "Ms." + super(HonirificCls, self).full_name()

    return HonirificCls


@honirific
class Name(object):
    def __init__(self, first_name, last_name):
        self.first_name = first_name
        self.last_name = last_name

    def full_name(self):
        return " ".join([self.first_name, self.last_name])