Where is the usage of (list comprehension) documented?

Ben Finney ben+python at benfinney.id.au
Sun Jan 14 20:41:54 EST 2018


Peng Yu <pengyu.ut at gmail.com> writes:

> > When you use square brackets, you're creating a generator, as in your
> > second example. Your first example is a slightly different beast
> > called a "generator expression". If you search for that in the docs or
> > on the web, you'll find what you want.
>
> Thanks. Can the documentation be found by `help()` in python?

The ‘help’ command is not intended to provide comprehensive user
documentation. Rather, it is intended primarily to provide a reminder of
syntax and purpose of specific API. It is not a replacement for having
the Python documentation available.

-- 
 \      “The history of Western science confirms the aphorism that the |
  `\     great menace to progress is not ignorance but the illusion of |
_o__)            knowledge.” —Daniel J. Boorstin, historian, 1914–2004 |
Ben Finney




More information about the Python-list mailing list