why pass statement?

Andrei see at my.signature.com
Tue Sep 16 17:28:52 EDT 2003


Originally posted by M-A-S

> A good idea! Thanks!

>

> "John Roth" <newsgroups at jhrothjr.com> wrote in message news:vme-
> q2go7e7fq62 at news.supernews.com"]news:vmeq2go7e7fq62 at news.supernews.co-
> m[/url]...

> > 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



I find "pass" shows that something could be there, sort of "insert stuff
here if you like/need to". A string as such doesn't have that effect.
Obviously you could always make up some useless statement instead of
pass, but pass just looks more elegant IMO. You probably should use it
if you plan on showing your code to others.


--
Contact info (decode with rot13): cebwrpg5 at bcrenznvy.pbz
Fcnzserr! Cyrnfr qb abg hfr va choyvp zrffntrf. V ernq gur yvfg, ab arrq gb PP.


Posted via http://dbforums.com




More information about the Python-list mailing list