Not logged in
Log in now
Create an account
Subscribe to LWN
LWN.net Weekly Edition for May 23, 2013
An "enum" for Python 3
An unexpected perf feature
LWN.net Weekly Edition for May 16, 2013
A look at the PyPy 2.0 release
Object oriented Lua
Posted Nov 17, 2011 23:33 UTC (Thu) by man_ls (subscriber, #15091)
Of course with Python you have the obnoxious self parameter, and Java is not functional (pun intended), but what can you do about it. Obvious sentence of the day: no language is perfect, and choosing the right one for a particular job is really hard.
Posted Nov 19, 2011 9:46 UTC (Sat) by alankila (subscriber, #47141)
Incidentally, Java would allow people to write Node.this to represent the Node object, assuming the function objects were written as anonymous inner classes.
Posted Nov 19, 2011 13:02 UTC (Sat) by man_ls (subscriber, #15091)
It can be worked around, of course: using a real closure, or calling the callback using weird call() techniques. But it makes for one of those "what were they thinking" moments. Same for prototypes, metatables' bastard son.
Awesome: A window manager that gets out of the way
Posted Nov 18, 2011 8:42 UTC (Fri) by alankila (subscriber, #47141)
Apparently he wanted python's semantics, too, and was dismayed to discover that some internal functions like __len were not overridable for some built-in types. I'm going to guess this restriction was because of performance.
Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds