What html5/js framework should I use for a webgame?
1 pointsby grot0 comments
In [27]: class Foo(object):
....: pass
....:
In [28]: def hello(self):
....: print self
....:
In [29]: blah = Foo()
In [30]: blah.hello = hello.__get__(blah, Foo)
In [31]: blah.hello()
<__main__.Foo object at 0x10397f650> In [21]: def hello(self):
....: print self.name
....:
In [22]: class Foo(object):
....: name = 'blah'
....:
In [23]: goo = Foo()
go
In [24]: goo.hi = hello
In [25]: goo.hi
Out[25]: <function hello at 0x103985aa0>
In [26]: goo.hi()
TypeError Traceback (most recent call last)
TypeError: hello() takes exactly 1 argument (0 given) var foo = Object();
foo.blah = function(x,y) { ... };
But in python, that doesn't quite work. You can only do foo = object()
foo.blah = lambda x,y: ...
lambdas are a bit more limited as they are restricted to one line, and you can't have print statements, which makes complicated expressions rather ugly. class Foo(object):
pass
I see your point though. I think he does use words in ways that native speakers do not use, but in his anecdotes -- I think he's actually playing up his Chineseness for the comic effect, and he's very much aware of what's happening.