Hacker News new | ask | show | jobs
by dragonwriter 1266 days ago
> - lots of "clever" things are possible in Python that just wouldn't be possible in the same way in Javascript

JS has Object.setPrototypeOf(), among other things, so I doubt this.

1 comments

In practice, that's very rarely used, partly because inheritance is so uncommon in Javascript programs. However, for a long time, Javascript lacked anything like the __getattr__/__setattr__ methods, it has no real operator overloading, and decorators are more limited and generally rare outside of certain ecosystems. These sorts of metaprogramming techniques that are very normal in Python are more rare in Javascript, and when they are present, they're generally easier to type.