Values and objects

Terry Reedy tjreedy at udel.edu
Sat May 10 16:24:21 EDT 2014


On 5/10/2014 3:22 PM, MRAB wrote:

> UnboundLocalError is like NameError,

More specifically,
 >>> isinstance(UnboundLocalError(), NameError)
True

This means that 'except NameError:' clauses written before the 
UnboundLocalError subclass was added still work and do not necessarily 
need to be modified. (I am allowing for the possibility that the body of 
the clause tries to separate the specific error from other NameErrors).

-- 
Terry Jan Reedy




More information about the Python-list mailing list