- Glossary - L
- ********
- lambda
- An anonymous inline function consisting of a single *expression*
- which is evaluated when the function is called. The syntax to
- create a lambda function is "lambda [parameters]: expression"
- LBYL
- Look before you leap. This coding style explicitly tests for pre-
- conditions before making calls or lookups. This style contrasts
- with the *EAFP* approach and is characterized by the presence of
- many "if" statements.
- In a multi-threaded environment, the LBYL approach can risk
- introducing a race condition between "the looking" and "the
- leaping". For example, the code, "if key in mapping: return
- mapping[key]" can fail if another thread removes *key* from
- *mapping* after the test, but before the lookup. This issue can be
- solved with locks or by using the EAFP approach.
- locale encoding
- On Unix, it is the encoding of the LC_CTYPE locale. It can be set
- with "locale.setlocale(locale.LC_CTYPE, new_locale)".
- On Windows, it is the ANSI code page (ex: ""cp1252"").
- On Android and VxWorks, Python uses ""utf-8"" as the locale
- encoding.
- "locale.getencoding()" can be used to get the locale encoding.
- See also the *filesystem encoding and error handler*.
- list
- A built-in Python *sequence*. Despite its name it is more akin to
- an array in other languages than to a linked list since access to
- elements is O(1).
- list comprehension
- A compact way to process all or part of the elements in a sequence
- and return a list with the results. "result = ['{:#04x}'.format(x)
- for x in range(256) if x % 2 == 0]" generates a list of strings
- containing even hex numbers (0x..) in the range from 0 to 255. The
- "if" clause is optional. If omitted, all elements in "range(256)"
- are processed.
- loader
- An object that loads a module. It must define a method named
- "load_module()". A loader is typically returned by a *finder*. See
- **PEP 302** for details and "importlib.abc.Loader" for an *abstract
- base class*.
Python software and documentation are licensed under the PSF License Agreement.
Starting with Python 3.8.6, examples, recipes, and other code in the documentation are dual licensed under the PSF License Agreement and the Zero-Clause BSD license.
Some software incorporated into Python is under different licenses. The licenses are listed with code falling under that license. See Licenses and Acknowledgements for Incorporated Software for an incomplete list of these licenses.
Python and it's documentation is:
Copyright © 2001-2022 Python Software Foundation. All rights reserved.
Copyright © 2000 BeOpen.com. All rights reserved.
Copyright © 1995-2000 Corporation for National Research Initiatives. All rights reserved.
Copyright © 1991-1995 Stichting Mathematisch Centrum. All rights reserved.
See History and License for complete license and permissions information:
https://docs.python.org/3/license.html#psf-license