PEP 416: add the default value of a function argument use case

This commit is contained in:
Victor Stinner 2012-03-04 00:07:10 +01:00
parent dda1526b8d
commit 6e7b0815b4
1 changed files with 2 additions and 0 deletions

View File

@ -42,6 +42,8 @@ Use cases:
* frozendict avoids the need of a read-only proxy in some cases. frozendict is * frozendict avoids the need of a read-only proxy in some cases. frozendict is
faster than a proxy because getting an item in a frozendict is a fast lookup faster than a proxy because getting an item in a frozendict is a fast lookup
whereas a proxy requires a function call. whereas a proxy requires a function call.
* use a frozendict as the default value of function argument: avoid the
problem of mutable default argument.
Constraints Constraints