• + 3 comments

    This one is a little longer but I think you'll find it easier to follow:

    class is_leap:
        pass
    is_leap.__init__ = lambda s,y: setattr(s,'y',y)
    is_leap.__repr__ = lambda s: str((not s.y%4)^(not s.y%100)^(not s.y%400))