You are viewing a single comment's thread. Return to all 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))
Seems like cookies are disabled on this browser, please enable them to open this website
Write a function
You are viewing a single comment's thread. Return to all comments →
This one is a little longer but I think you'll find it easier to follow: