Clarify how tuple parameters do not work with PEP 3102 and 3107.

This commit is contained in:
Brett Cannon 2007-03-04 19:26:52 +00:00
parent 86ee25c609
commit 74cc408ab9
1 changed files with 6 additions and 3 deletions

View File

@ -113,9 +113,12 @@ exception rather than the rule.
Consider PEP 3102 (keyword-only arguments) and PEP 3107 (function
annotations) [#pep-3102]_ [#pep-3107]_. Both PEPs have been accepted and
introduce new functionality within a function's signature. And yet
for both PEPs the new feature cannot be applied to tuple parameters.
This leads to tuple parameters not being on the same footing as
regular parameters that do not attempt to unpack their arguments.
for both PEPs the new feature cannot be applied to tuple parameters as
a whole. PEP 3102 has no support for tuple parameters at all (which
makes sense as there is no way to reference a tuple parameter by
name). PEP 3107 allows annotations for each item within the tuple
(e.g., ``(x:int, y:int)``), but not the whole tuple (e.g.,
``(x, y):int``).
The existence of tuple parameters also places sequence objects
separately from mapping objects in a function signature. There is no