Reject the idea of using 'def' as a keyword.

This commit is contained in:
Guido van Rossum 2016-09-01 08:12:18 -07:00
parent 923cdf93d8
commit 9461d121e4
1 changed files with 11 additions and 0 deletions

View File

@ -435,6 +435,17 @@ Rejected proposals and things left out for now
globals. Second, no matter what we choose, we'd still need
a ``__future__`` import.
- **Use 'def' as a keyword:**
The proposal would be::
def primes: List[int] = []
def captain: str
The problem with this is that ``def`` means "define a function" to
generations of Python programmers (and tools!), and using it also to
define variables does not increase clarity. (Though this is of
course subjective.)
- **Allow type annotations for tuple unpacking:**
This causes an ambiguity: It's not clear what meaning should be
assigned to this statement::