Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #50697

Re: Is this a bug?

References <51E41A5C.7060903@nottheoilrig.com>
From Zachary Ware <zachary.ware+pylist@gmail.com>
Date 2013-07-15 11:06 -0500
Subject Re: Is this a bug?
Newsgroups comp.lang.python
Message-ID <mailman.4737.1373904396.3114.python-list@python.org> (permalink)

Show all headers | View raw


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

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

--
Zach

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Is this a bug? Zachary Ware <zachary.ware+pylist@gmail.com> - 2013-07-15 11:06 -0500

csiph-web