diff --git a/README.md b/README.md index 2c4122f..5b1ae77 100644 --- a/README.md +++ b/README.md @@ -679,8 +679,8 @@ def f(): # def f(x, y): def f(): # def f(x=0, y=0): def f(, ): # def f(x, y=0): ``` -* **Value of a default argument is evaluated when function is first encountered in the scope.** -* **If this value is a mutable object, then all its mutations will persist between invocations.** +* **Default values are evaluated when function is first encountered in the scope.** +* **Any mutations of mutable default values will persist between invocations.** Splat Operator diff --git a/index.html b/index.html index f4b1821..8c71ccd 100644 --- a/index.html +++ b/index.html @@ -601,8 +601,8 @@ to_exclusive = <range>.stop
    -
  • Value of a default argument is evaluated when function is first encountered in the scope.
  • -
  • If this value is a mutable object, then all its mutations will persist between invocations.
  • +
  • Default values are evaluated when function is first encountered in the scope.
  • +
  • Any mutations of mutable default values will persist between invocations.

#Splat Operator

Inside Function Call

Splat expands a collection into positional arguments, while splatty-splat expands a dictionary into keyword arguments.

args   = (1, 2)
 kwargs = {'x': 3, 'y': 4, 'z': 5}