45 Python Setup and Usage, Release 3.9.5 See PEP 302 , PEP 420 and PEP 451 for much more detail. Function annotations are usually used for type hints : for example, this function is expected to take two int arguments and is also expected to have an int return value: Function annotation syntax is explained in section function. See variable annotation and PEP 484 , which describe this functionality. By importing the __future__ module and evaluating its variables, you can see when a new feature was first added to the language and when it becomes the default: Usually refers to a generator function, but may refer to a generator iterator in some contexts. In cases where the intended meaning isn’t clear, using the full terms avoids ambiguity. Each$_{yield}$ temporarily suspends processing, remembering the location execution state (including local vari- ables and pending try-statements). When the generator iterator resumes, it picks up where it left off (in contrast to functions which start fresh on every invocation). See also the single dispatch glossary entry, the$_{functools.singledispatch()}$ decorator, and PEP 443 . See PEP 483 for more details, and$_{typing}$or generic alias type for its uses. GIL See global interpreter lock . generic type A type that can be parameterized; typically a container like$_{list}$. Used for type hints and annotations . generic function A function composed of multiple functions implementing the same operation for different types. Which implementation should be used during a call is determined by the dispatch algorithm. generator expression An expression that returns an iterator. It looks like a normal expression followed by a$_{for}$ clause defining a loop variable, range, and an optional$_{if}$ clause. The combined expression generates values for an enclosing function: generator iterator An object created by a generator function. generator A function which returns a generator iterator . It looks like a normal function except that it contains$_{yield}$ expressions for producing a series of values usable in a for-loop or that can be retrieved one at a time with the next() function. garbage collection The process of freeing memory when it is not used anymore. Python performs garbage collection via reference counting and a cyclic garbage collector that is able to detect and break reference cycles. The garbage collector can be controlled using the$_{gc}$module. __future__ A pseudo-module which programmers can use to enable new language features which are not compatible with the current interpreter. function annotation An annotation of a function parameter or return value. function A series of statements which returns some value to a caller. It can also be passed zero or more arguments which may be used in the execution of the body. See also parameter , method , and the function section. floor division Mathematical division that rounds down to nearest integer. The floor division operator is$_{//}$ . For example, the expression$_{11 // 4}$ evaluates to$_{2}$in contrast to the$_{2.75}$ returned by float true division. Note that (-11) // 4 is -3 because that is -2.75 rounded downward . See PEP 238 . def sum_two_numbers (a:int, b:int)->int: return a +b >>> import __future__ >>> __future__ .division _Feature((2, 2, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), >>> sum(i*i for i in range(10 )) # sum of squares 0, 1, 4, ... 285