Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #25344 > unrolled thread

Re: Implicit conversion to boolean in if and while statements

Started byStefan Behnel <stefan_ml@behnel.de>
First post2012-07-15 11:17 +0200
Last post2012-07-15 11:17 +0200
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Implicit conversion to boolean in if and while statements Stefan Behnel <stefan_ml@behnel.de> - 2012-07-15 11:17 +0200

#25344 — Re: Implicit conversion to boolean in if and while statements

FromStefan Behnel <stefan_ml@behnel.de>
Date2012-07-15 11:17 +0200
SubjectRe: Implicit conversion to boolean in if and while statements
Message-ID<mailman.2135.1342343843.4697.python-list@python.org>
Andrew Berg, 15.07.2012 10:34:
> This has probably been discussed before, but why is there an implicit
> conversion to a boolean in if and while statements?

There isn't. This has nothing to do with "if" or "while".

All objects have a truth value in Python, evaluating to True by default
(object), unless they implement the test themselves.

As Chris said, very convenient.

Stefan

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web