|
Original |
Translation |
|
37
|
An expression that returns an iterator. It looks like a normal expression followed by a :keyword:`for` expression defining a loop variable, range, and an optional :keyword:`if` expression. The combined expression generates values for an enclosing function::
|
|
|
38
|
>>> sum(i*i for i in range(10)) # sum of squares 0, 1, 4, ... 81 285
|
|
|
39
|
See :term:`global interpreter lock`.
|
|
|
40
|
The lock used by Python threads to assure that only one thread executes in the :term:`CPython` :term:`virtual machine` at a time. This simplifies the CPython implementation by assuring that no two processes can access the same memory at the same time. Locking the entire interpreter makes it easier for the interpreter to be multi-threaded, at the expense of much of the parallelism afforded by multi-processor machines. Efforts have been made in the past to create a "free-threaded" interpreter (one which locks shared data at a much finer granularity), but so far none have been successful because performance suffered in the common single-processor case.
|
|
|
41
|
|
42
|
Hashability makes an object usable as a dictionary key and a set member, because these data structures use the hash value internally.
|
|
|
43
|
All of Python's immutable built-in objects are hashable, while no mutable containers (such as lists or dictionaries) are. Objects which are instances of user-defined classes are hashable by default; they all compare unequal, and their hash value is their :func:`id`.
|
|
|
44
|
An Integrated Development Environment for Python. IDLE is a basic editor and interpreter environment which ships with the standard distribution of Python. Good for beginners, it also serves as clear example code for those wanting to implement a moderately sophisticated, multi-platform GUI application.
|
|
|
45
|
An object with a fixed value. Immutable objects include numbers, strings and tuples. Such an object cannot be altered. A new object has to be created if a different value has to be stored. They play an important role in places where a constant hash value is needed, for example as a key in a dictionary.
|
|
|
46
|
An object that both finds and loads a module; both a :term:`finder` and :term:`loader` object.
|
|