Reject the idea of using 'def' as a keyword.
This commit is contained in:
parent
923cdf93d8
commit
9461d121e4
11
pep-0526.txt
11
pep-0526.txt
|
@ -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::
|
||||
|
|
Loading…
Reference in New Issue