for / while else doesn't make sense

Grant Edwards grant.b.edwards at gmail.com
Fri May 20 22:17:28 EDT 2016


On 2016-05-20, Steven D'Aprano <steve at pearwood.info> wrote:
> On Sat, 21 May 2016 05:20 am, Christopher Reimer wrote:
>
>> According to "Effective Python: 59 Specific Ways to Write Better Python"
>> by Brett Slatkin, Item 12 recommends against using the else block after
>> for and while loops (see page 25): "Avoid using else blocks after loops
>> because their behavior isn't intuitive and can be confusing."
>
> By that logic, we ought to:
>
> - avoid using floats because their behaviour isn't intuitive and
>   can be confusing;

Well, a lot of people probably should avoid floats.  I've often said
that anybody who hasn't taken a numerical methods class shouldn't be
allowed to use floating point.

--
Grant







More information about the Python-list mailing list