Re: Debugging decorator

Discussion in 'Python' started by Chris Angelico, Oct 28, 2013.

  1. On Mon, Oct 28, 2013 at 11:43 PM, Schneider <> 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
    Chris Angelico, Oct 28, 2013
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. glomde
    Replies:
    5
    Views:
    518
    glomde
    Mar 29, 2007
  2. Yaþar Arabacý

    Debugging decorator

    Yaþar Arabacý, Oct 26, 2013, in forum: Python
    Replies:
    0
    Views:
    73
    Yaþar Arabacý
    Oct 26, 2013
  3. Chris Angelico

    Re: Debugging decorator

    Chris Angelico, Oct 26, 2013, in forum: Python
    Replies:
    0
    Views:
    102
    Chris Angelico
    Oct 26, 2013
  4. Eric S. Johansson

    Re: Debugging decorator

    Eric S. Johansson, Oct 27, 2013, in forum: Python
    Replies:
    0
    Views:
    99
    Eric S. Johansson
    Oct 27, 2013
  5. Schneider

    Re: Debugging decorator

    Schneider, Oct 28, 2013, in forum: Python
    Replies:
    0
    Views:
    82
    Schneider
    Oct 28, 2013
Loading...

Share This Page