Clean Singleton Docstrings

Chris Angelico rosuav at gmail.com
Sat Jul 16 02:29:18 EDT 2016


On Sat, Jul 16, 2016 at 4:19 PM, Lawrence D’Oliveiro
<lawrencedo99 at gmail.com> wrote:
> On Saturday, July 16, 2016 at 4:20:13 PM UTC+12, Ethan Furman wrote:
>>
>> On 07/15/2016 09:04 PM, Rustom Mody wrote:
>>
>>> Just that suggesting that python's bool notion is straightforward is an
>>> unnecessary lie – especially to newbies.
>>
>> Python's boolean concept is as simple as it gets -- what is not
>> straightforward about it?
>
> The fact that it led to the aforementioned bug.

The difference between ints and floats can lead to bugs, too. Which
one should we eliminate?

Tuple augmented assignment can lead to extremely confusing bugs. Let's
abolish augmented assignment. Or tuples?

Operator precedence leads to bugs when people don't respect it.
Eliminate it; all operators function at the same precedence, with
middle-to-outside associativity (as popularized by the "if/else"
ternary operator).

There. Now we have a bug-free language.

Tongue removed from cheek... The Python policy is a *lot* easier to
work with than REXX's policy is. In REXX, if you put a value in an IF
statement that isn't its canonical True or False (in its case, "1" and
"0"), you get a run-time error. Python lets you use None, False, 0,
etc, as falsey, and if you really want a comparison, you put it in
there. How is this a problem?

As demonstrated elsewhere, the problem isn't the boolification. The
problem is that an 'if' was used where exception handling would have
been far better.

ChrisA



More information about the Python-list mailing list