Hacker News new | ask | show | jobs
by andybak 4381 days ago
In some ways Python is more liberal but in different areas - Metaclasses, 'magic' methods (hooking into __getattr__ allows some very clever behaviour), operator overloading, control of the abstract syntax tree and doing crazy stuff with imports. Try doing some of that in javascript.

You want prototypical inheritance? Here you go: http://tobyho.com/2009/05/23/prototype-inheritence-in/

Monkeypathing? Nothing forbids it other than a sea of raised eyebrows if there was a cleaner way to achieve the same thing.

The only limitation Python has with first-level functions is that they can't be anonymous. I know a lot of people chafe at this but I've never seen any javascript code that wouldn't be improved by removing a couple of levels of nested anonymous functions ;-)