Python keywords

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Thu Apr 26 12:03:44 EDT 2007


In <1177599386.204340.65680 at r35g2000prh.googlegroups.com>, gtb wrote:

> Have done some searching but have not found a place where I can look
> up python keywords. I was looking at a script that contained the
> following line:
> 
> assert self.getResponseCode() in (200, 304, 302)
> 
> I can infer the usage here but previously I had thought that "in" was
> only used with '"for". I looked thru 'the Python Reference Manual and
> found "in" is a keyword but in skimming thru I found it only with
> "for". The reference manual seems good but seems not to be setup for
> searching. Or maybe I just missed something.

If you look in the library reference index you'll find a link to the
`Sequence Types`_ section where it is mentioned as an operator that tests
if some object "contains" another.  And the reference manual has an index
entry called `in operator` which leads to the page Comparisons_, telling
how to overwrite the behaviour in your own classes.

.. _Sequence Types: http://docs.python.org/lib/typesseq.html
.. _Comparisons: http://docs.python.org/ref/comparisons.html

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list