PEP 671: Document QUERY_DEREF among implementation details
This commit is contained in:
parent
21f6993114
commit
2f8088c384
|
@ -167,11 +167,11 @@ calculated as the function begins.
|
||||||
|
|
||||||
When a parameter with a late-bound default is omitted, the function will begin
|
When a parameter with a late-bound default is omitted, the function will begin
|
||||||
with the parameter unbound. The function begins by testing for each parameter
|
with the parameter unbound. The function begins by testing for each parameter
|
||||||
with a late-bound default using a new opcode QUERY_FAST, and if unbound,
|
with a late-bound default using a new opcode QUERY_FAST/QUERY_DEREF, and if
|
||||||
evaluates the original expression. This opcode (available only for fast locals
|
unbound, evaluates the original expression. This opcode (available only for
|
||||||
and not for other types of variable) pushes True onto the stack if the given
|
fast locals and closure variables) pushes True onto the stack if the given
|
||||||
local has a value, and False if not - meaning that it pushes False if LOAD_FAST
|
local has a value, and False if not - meaning that it pushes False if LOAD_FAST
|
||||||
would raise UnboundLocalError and True if it would succeed.
|
or LOAD_DEREF would raise UnboundLocalError, and True if it would succeed.
|
||||||
|
|
||||||
Out-of-order variable references are permitted as long as the referent has a
|
Out-of-order variable references are permitted as long as the referent has a
|
||||||
value from an argument or early-bound default.
|
value from an argument or early-bound default.
|
||||||
|
|
Loading…
Reference in New Issue