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


Groups > comp.lang.python > #57818

Re: Debugging decorator

References <CAFEUn8YwMwB6m9LGqsXK8iijK_DRnwv88Xxp8VP_x=Hq2TUnhQ@mail.gmail.com> <526E5BFA.5080505@globe.de>
Date 2013-10-29 00:00 +1100
Subject Re: Debugging decorator
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.1698.1382965265.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Mon, Oct 28, 2013 at 11:43 PM, Schneider <js@globe.de> wrote:
> 2. In the case of an assignment (but holds for the return statement too).
> think about the following code:
>
> a = 0
> @debugging
> def foo():
>     a = a +  1
>
> def bar():
>     #assign something else to a
>
> Imagine foo() and bar() being called in two different threads.

I think threading considerations are rather outside the scope of this
tool. If you're trying to figure out what happens when two threads
mutate the same global, you really want something a lot more
heavy-duty... possibly static code analysis to work out what *might*
happen, rather than what *did* happen this particular run.

ChrisA

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


Thread

Re: Debugging decorator Chris Angelico <rosuav@gmail.com> - 2013-10-29 00:00 +1100

csiph-web