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


Groups > comp.lang.python > #57818

Re: Debugging decorator

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.012
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'static': 0.04; 'assignment': 0.07; 'global,': 0.09; 'happen,': 0.09; 'def': 0.12; 'foo()': 0.16; 'foo():': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'threads.': 0.16; 'too).': 0.16; 'tool.': 0.16; 'wrote:': 0.18; 'trying': 0.19; '(but': 0.19; 'mon,': 0.24; 'holds': 0.26; 'possibly': 0.26; 'code:': 0.26; 'header:In-Reply-To:1': 0.27; 'statement': 0.30; 'message- id:@mail.gmail.com': 0.30; 'code': 0.31; 'figure': 0.32; 'something': 0.35; 'received:google.com': 0.35; 'really': 0.36; 'two': 0.37; 'being': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'rather': 0.38; 'to:addr:python.org': 0.39; 'called': 0.40; "you're": 0.61; 'happen': 0.63; 'more': 0.64; 'different': 0.65; 'analysis': 0.75; 'imagine': 0.93; '2013': 0.98
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=DqlCPtc2R58Gpkl/upwQgMbM38EMtteLAky/Fz3RcGQ=; b=c0e8pImNvp+xr8EA8NFBQnhTwxlT5OMqW75fv3Q+KE2QNePGjjmOhgmfZYBltnnW+a YZBqsj0UH5C/ET4KeK5B7Qa7cxisvRWSef9kLY2jCR1MWxhuDgp+rWqK5PJvb+qEymKU MJwMNmzMYs/BogsFH8bK+L6XvYH/Rx0ESI532jt2kfmimOek1eTkWuM+OuWMbCX9c2mf Ykm88T4dRsVzfLwqfw1/fY+hKxE5JDwVT6oXw6w7HFU6I3NO5G0btXYRoXxe6G+AFmn7 ua8zhBZ/JEFct2VqjNnpaqbidHxC7JIg0ecCmo95xLyoBUWwyPJvOMwef8yfV6HAf3iI nycA==
MIME-Version 1.0
X-Received by 10.68.182.3 with SMTP id ea3mr16161907pbc.124.1382965253128; Mon, 28 Oct 2013 06:00:53 -0700 (PDT)
In-Reply-To <526E5BFA.5080505@globe.de>
References <CAFEUn8YwMwB6m9LGqsXK8iijK_DRnwv88Xxp8VP_x=Hq2TUnhQ@mail.gmail.com> <526E5BFA.5080505@globe.de>
Date Tue, 29 Oct 2013 00:00:53 +1100
Subject Re: Debugging decorator
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1698.1382965265.18130.python-list@python.org> (permalink)
Lines 21
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1382965265 news.xs4all.nl 15864 [2001:888:2000:d::a6]:38570
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:57818

Show key headers only | 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