# HG changeset patch # User Jeff Hammel # Date 1477705606 25200 # Node ID 0fffb356064187fa455ceb2f32a8497dc818fd11 # Parent 0afeb265da7f24c5be821c6e36f8d2339d8dbdc4 not sure if we need this but we will keep it for now diff -r 0afeb265da7f -r 0fffb3560641 python/aspects.py --- a/python/aspects.py Fri Oct 28 17:33:35 2016 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ -class MakePythonLikeJavascript(object): - def __getattr__(self, name): - return undefined - -class undefined(MakePythonLikeJavascript): - def __nonzero__(self): - return False - def __str__(self): - return 'undefined' - __repr__ = __str__ -undefined = undefined() # singleton - -if __name__ == '__main__': - foo = MakePythonLikeJavascript() - foo.bar = 5 - print foo.bar - print foo.fleem - print foo.fleem.flarg diff -r 0afeb265da7f -r 0fffb3560641 python/example/aspects.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/python/example/aspects.py Fri Oct 28 18:46:46 2016 -0700 @@ -0,0 +1,18 @@ +class MakePythonLikeJavascript(object): + def __getattr__(self, name): + return undefined + +class undefined(MakePythonLikeJavascript): + def __nonzero__(self): + return False + def __str__(self): + return 'undefined' + __repr__ = __str__ +undefined = undefined() # singleton + +if __name__ == '__main__': + foo = MakePythonLikeJavascript() + foo.bar = 5 + print foo.bar + print foo.fleem + print foo.fleem.flarg