为何通过声明? [英] why pass statement?

查看:80
本文介绍了为何通过声明?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么会有通行证?我认为,表达陈述就足够了:


C级:




而真:




Why is there the pass statement? I think, the expression statement would be enough:

class C:
None

while True:
None


推荐答案

MaS写道:
M-a-S wrote:
为什么会有通行证?我认为,表达陈述就足够了:

C类:
没有

而真:
Why is there the pass statement? I think, the expression statement would be enough:

class C:
None

while True:
None



编号没有只是一个值(现在是可变的),而不是一个声明。


hth,

anton。


No. None is just a value (now variable), not a statment.

hth,
anton.


MaS写道:

为什么会有pass语句?我认为,表达陈述就足够了:

C类:
没有

而真:

Why is there the pass statement? I think, the expression statement would be enough:

class C:
None

while True:
None




为了便于阅读。通行证更有意义。你似乎认为极简主义

天生就是好的...(?)


-Peter



For readability. Pass makes more sense. You seem to think minimalism
is inherently good... (?)

-Peter




" Ma-S" < NO ***** @ hotmail.com>在消息中写道

新闻:iR ****************** @ twister.southeast.rr.com ...

"M-a-S" <NO*****@hotmail.com> wrote in message
news:iR******************@twister.southeast.rr.com ...
为什么有通行证?我想,表达声明就足够了

C级:
没有

而真:



你不需要通行证。一个docstring就足够了:


class C:

这是一个类


而True:

" loop de loop de loop"

John Roth

Why is there the pass statement? I think, the expression statement would be enough:
class C:
None

while True:
None
You don''t actally need Pass. A docstring is sufficient:

class C:
"this is a class"

while True:
"loop de loop de loop"

John Roth



这篇关于为何通过声明?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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