Merge pull request #13292 from The-Arbiter/Function_modifiers_placeholder

Placeholder elaboration in function-modifiers.rst
This commit is contained in:
Leo 2022-08-30 12:50:49 +02:00 committed by GitHub
commit 3658d8abc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -111,6 +111,12 @@ whitespace-separated list and are evaluated in the order presented.
Modifiers cannot implicitly access or change the arguments and return values of functions they modify. Modifiers cannot implicitly access or change the arguments and return values of functions they modify.
Their values can only be passed to them explicitly at the point of invocation. Their values can only be passed to them explicitly at the point of invocation.
In function modifiers, it is necessary to specify when you want the function to which the modifier is
applied to be run. The placeholder statement (denoted by a single underscore character ``_``) is used to
denote where the body of the function being modified should be inserted. Note that the
placeholder operator is different from using underscores as leading or trailing characters in variable
names, which is a stylistic choice.
Explicit returns from a modifier or function body only leave the current Explicit returns from a modifier or function body only leave the current
modifier or function body. Return variables are assigned and modifier or function body. Return variables are assigned and
control flow continues after the ``_`` in the preceding modifier. control flow continues after the ``_`` in the preceding modifier.