Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: Debugging decorator

Reply
Thread Tools

Re: Debugging decorator

 
 
Chris Angelico
Guest
Posts: n/a
 
      10-28-2013
On Mon, Oct 28, 2013 at 11:43 PM, Schneider <(E-Mail Removed)> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Debugging decorator Schneider Python 0 10-28-2013 12:43 PM
Re: Debugging decorator Eric S. Johansson Python 0 10-27-2013 05:49 PM
Re: Debugging decorator Chris Angelico Python 0 10-26-2013 03:08 AM
Debugging decorator Yaar Arabac Python 0 10-25-2013 11:55 PM
Why doesnt __getattr__ with decorator dont call __get_method in decorator glomde Python 5 03-29-2007 02:48 PM



Advertisments