Clarify once more that "if []" will remain valid Python forever.
This commit is contained in:
parent
74271e0dcd
commit
b0cf9e95d0
12
pep-0285.txt
12
pep-0285.txt
|
@ -115,6 +115,18 @@ Review
|
|||
container is interpreted as a truth value, an empty container
|
||||
is considered false and a non-empty one is considered true."
|
||||
|
||||
8) Should we strive to require that Boolean operations (like "if",
|
||||
"and", "not") have a bool as an argument in the future, so that
|
||||
for example "if []:" would become illegal and would have to be
|
||||
writen as "if bool([]):" ???
|
||||
|
||||
=> No!!! Some people believe that this is how a language with a
|
||||
Boolean type should behave. Because it was brought up, others
|
||||
have worried that I might agree with this position. Let me
|
||||
make my position on this quite clear. This is not part of the
|
||||
PEP's motivation and I don't intend to make this change. (See
|
||||
also the section "Clarification" below.)
|
||||
|
||||
|
||||
Rationale
|
||||
|
||||
|
|
Loading…
Reference in New Issue