TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Python isn't just Java without the compile

12 pointsby ramsalmost 17 years ago

4 comments

benreesmanalmost 17 years ago
"In some ways it makes the problem easier when you can assume the user is a good programmer. Language designers often find themselves worrying about the mess users might make if they were allowed to do such-and-such. Once you assume the user is a good programmer, you automatically have the answer to any such question: let the user do whatever he wants."<p>- pg<p>"About 12 years ago, Python aquired lambda, reduce(), filter() and map(), courtesy of (I believe) a Lisp hacker who missed them and submitted working patches. But, despite of the PR value, I think these features should be cut from Python 3000."<p>- gvr<p>Remember: Python's not broken, you are.
k4stalmost 17 years ago
The example given in the articles entirely fails to describe functions as being first-class citizens. Python also lacks full continuations, unless the article is referring to Stackless Python. What is described in the article as continuations are actually generators. Finally, the meta-programming described in the article, while valid, really only scratches the surface of what's possible with meta classes in Python.
评论 #247595 未加载
rbanffyalmost 17 years ago
Try that in Java:<p>class NullReceiver(object):<p><pre><code> class SimpleCallable(object): def __call__(self, *args): pass def __getattr__(self, name): print 'unhandled method "%s" called' % name return nullReceiver.SimpleCallable()</code></pre>
rbanffyalmost 17 years ago
Or that (this one is in Ruby):<p>s = 'a'<p>class String<p><pre><code> def rghize return self + 'rgh' end </code></pre> end<p>puts s.rghize