Is this a bug?

Zachary Ware zachary.ware+pylist at
Mon Jul 15 18:06:09 CEST 2013

On Mon, Jul 15, 2013 at 10:50 AM, Jack Bates <tdhfwh at> wrote:
> Hello,
> Is the following code supposed to be an UnboundLocalError?
> Currently it assigns the value 'bar' to the attribute
>    foo = 'bar'
>    class baz:
>       foo = foo

No bug.  It's not an error because of differences in the way classes
and functions compile.


More information about the Python-list mailing list