Encapsulation, inheritance and polymorphism
Steven D'Aprano
steve+comp.lang.python at pearwood.info
Wed Jul 18 21:23:59 EDT 2012
On Wed, 18 Jul 2012 12:33:01 -0400, Dave Angel wrote:
> On 07/18/2012 08:58 AM, Steven D'Aprano wrote:
>> <SNIP>
>> For bonus points, can you see the mistake?
[...]
>>
> There are actually two bugs in that function. One is in the assertion,
> but more importantly, there's a typo earlier. One that would give a
> traceback, so it would be caught quickly.
>
> UnboundLocalError: local variable 'x' referenced before assignment
Good catch :)
--
Steven
More information about the Python-list
mailing list