Python被认为是有害的 [英] Python is Considered Harmful

查看:76
本文介绍了Python被认为是有害的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

女士们,先生们,


我向你们展示了Python'

脑损伤的最终证据:


你可能还记得,


flist = []


for i in range(3)

f = lambda x:x + i

flist.append(f)


[f(1)for f in flist]


在Python中生成[3,3,3]。


在Haskell中,我们将表达如下:

map(\f - > f 1)[\ x - > x + i |我< - [0..2]]


这当然是评估预期的[1,2,3]

正如你可能听说的那样,慷慨的GvR让我们在Python中写了相同的(字面翻译,真的):


map(lambda f) :f(1),[lambda x:x + 1 for i in range(3)])


您认为此评估结果如何:[1,2,3]或[3,3,3]

和以前一样?


再猜一次,它是[2,2,2]!


ROTFLMFAO!


Pythonista,非常欢迎你学习Haskell。

你会发现语法非常熟悉。 Haskell也很简单

(比较上面的一行给出了令你惊讶的几行Python行的正确

结果)


所有这些Python抨击开始感觉像嘲笑

a智障儿童...



Ladies and Gentlemen,

I present to you the final and ultimate proof of Python''s
brain-damage:

As you may remember,

flist = []

for i in range(3)
f = lambda x: x + i
flist.append(f)

[f(1) for f in flist]

produces [3, 3, 3] in Python.

In Haskell, we would express this as follows:

map (\f -> f 1) [\x -> x + i | i <- [0..2]]

This, of course, evaluates to the expected [1, 2, 3]

As you might have heard, the ever so generous GvR allowed us write
the same in Python (literal translation, really):

map(lambda f: f(1), [lambda x: x + 1 for i in range(3)])

What do you think this evaluates to: also [1, 2, 3] or [3, 3, 3]
as before?

Guess again, it''s [2, 2, 2] !

ROTFLMFAO!

Pythonista, you are all very welcome to learn Haskell.
You will find the syntax very familiar. Haskell is short
too (compare one line above that gives the correct
result to several Python lines that surprise you)

All this Python bashing is starting to feel like mocking
a retarded child...

420

推荐答案

On Sun,2003年10月26日22:25:41 -0800(太平洋标准时间)
mi *** **@ziplip.com 写道:


女士们,先生们,


我向您呈现最终证明mike420的

脑损伤:


在Haskell中,我们将表达如下:


地图(\f - > f 1)[\ x - > x + 1 |我< - [0..2]]


这当然是评估预期的[2,2,2]

map(lambda f:f(1),[lambda x:x + 1 for i in range(3)])


您认为此评估结果如何:还[1] ,2,3,或[3,3,3]

和以前一样?


它是[2,2,2]!


-


你是一个公然的巨魔,现在是一个公开的白痴。请你

消失?当你学习1 + 1 = 2时,你可以考虑回来。
On Sun, 26 Oct 2003 22:25:41 -0800 (PST)
mi*****@ziplip.com wrote:

Ladies and Gentlemen,

I present to you the final and ultimate proof of mike420''s
brain-damage:

In Haskell, we would express this as follows:

map (\f -> f 1) [\x -> x + 1 | i <- [0..2]]

This, of course, evaluates to the expected [2, 2, 2]

map(lambda f: f(1), [lambda x: x + 1 for i in range(3)])

What do you think this evaluates to: also [1, 2, 3] or [3, 3, 3]
as before?

It''s [2, 2, 2] !

-

You are a blatant troll and now a public moron to boot. Will you please
go away? You may consider coming back when you learn 1+1=2.


mi * ****@ziplip.com 写道:
mi*****@ziplip.com writes:
我向你展示了Python'脑损伤的最终证据:


-1,巨魔。

map(lambda f:f(1),[lambda x:x + 1 for i in range(3)])
再猜一次,它是[2,2,2]!


是,1 + 1 == 2,通常值为1.

Pythonista,非常欢迎您学习Haskell。


...

所有这些Python抨击开始感觉像是在嘲笑一个弱智的孩子......
I present to you the final and ultimate proof of Python''s
brain-damage:
-1, Troll.
map(lambda f: f(1), [lambda x: x + 1 for i in range(3)]) Guess again, it''s [2, 2, 2] !
Yes, 1+1 == 2 for usual values of 1.
Pythonista, you are all very welcome to learn Haskell.
...
All this Python bashing is starting to feel like mocking
a retarded child...



好​​吧,Haskell社区似乎至少是友好的一群。


-

Ville Vainio http://www.students.tut.fi/~vainio24


嗯......我认为Haskell语法看起来像垃圾。 ;)说真的,如果没有某种手册,我甚至无法猜测它是如何工作的。当然,如果你不知道名字绑定的规则,那么Python结果

只是''令人惊讶'。


我是当然,不要抨击哈斯克尔。我只是说我已经不喜欢了......


- Kef

Hmm...I think the Haskell syntax looks like crap. ;) Seriously, I can''t even
guess how it works without some kind of manual. And of course the Python result
is only ''surprising'' if you don''t know the rules of name binding.

I''m not bashing Haskell, of course. I''m just saying I already don''t like it...

- Kef


这篇关于Python被认为是有害的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆