[Tutor] What is the difference between checking false?

Chris “Kwpolska” Warrick kwpolska at gmail.com
Sun Jun 16 16:06:13 CEST 2013


On Sun, Jun 16, 2013 at 7:52 AM, Jim Mooney <cybervigilante at gmail.com> wrote:
> On 15 June 2013 22:32, Steven D'Aprano <steve at pearwood.info> wrote:
>> http://mail.python.org/pipermail/python-list/2013-June/649710.html
>
> A succinct list - worth putting in my Keep file ;')
>
> -
> Jim
> After indictment the bacon smuggler was put on the no-fry list
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor

Another thing worthy putting there may be may be the three ways to do
`if` statements to compare stuff:

1. `if x` — runs bool(x), see list above, can be negated by `if not x`
2. `if x == y` — tests if they have the same value, negated by `if x
!= y` or `if not x == y` (not used).
3. `if x is y` — tests if they are the same object, used for `is
None`/`is not None` comparisons and not much else.
-- 
Kwpolska <http://kwpolska.tk> | GPG KEY: 5EAAEA16
stop html mail                | always bottom-post
http://asciiribbon.org        | http://caliburn.nl/topposting.html


More information about the Tutor mailing list