First attempt at a Python prog (Chess)

Neil Cerutti neilc at norwich.edu
Tue Feb 19 16:10:44 EST 2013


On 2013-02-15, MRAB <python at mrabarnett.plus.com> wrote:
> On 2013-02-15 16:17, Neil Cerutti wrote:
>> On 2013-02-15, Oscar Benjamin <oscar.j.benjamin at gmail.com> wrote:
>>> if score > best_score or best_score is None:
>>
>> You need the None check first to avoid an exception from the
>> comparison.
>
> Only in Python 3.

It is a more difficult to find bug in Python 2, which will not
even throw an exception, but instead silently do the wrong thing.

-- 
Neil Cerutti



More information about the Python-list mailing list