Created
February 17, 2013 15:43
-
-
Save niccokunzmann/4971938 to your computer and use it in GitHub Desktop.
Coming closer to my goal of subjective programming
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# see https://github.com/niccokunzmann/wwp | |
from relative import roleOf, useRoles | |
@roleOf(int) | |
class NaturalNumber: | |
@property | |
def successor(self): | |
return self + 1 | |
@useRoles | |
def test(): | |
# this is possible if we recompile the code objects | |
i = 1 | |
assert i.successor == 2 | |
if __name__ == '__main__': | |
test() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment