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


Groups > comp.lang.python > #76663

Re: MacroPy tracing not working for me...

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <skip.montanaro@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'subject:not': 0.03; 'failing': 0.07; '[0,': 0.09; 'cc:addr:python-list': 0.11; '-&gt;': 0.16; 'from:addr:pobox.com': 0.16; 'from:addr:skip': 0.16; 'nose': 0.16; 'operates': 0.16; 'range(0,': 0.16; 'repl': 0.16; 'sender:addr:gmail.com': 0.17; 'wrote:': 0.18; 'wed,': 0.18; 'module': 0.19; '>>>': 0.22; 'import': 0.22; 'aug': 0.22; 'email addr:gmail.com&gt;': 0.22; 'issue.': 0.22; 'cc:addr:python.org': 0.22; '&gt;&gt;&gt;': 0.24; 'byte': 0.24; 'skip': 0.24; 'test.': 0.24; "haven't": 0.24; 'looks': 0.24; 'cc:2**0': 0.24; 'somewhere': 0.26; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'chris': 0.29; 'am,': 0.29; 'raise': 0.29; "doesn't": 0.30; 'message-id:@mail.gmail.com': 0.30; 'asked': 0.31; 'enabled': 0.31; 'trace': 0.31; 'there.': 0.32; 'level.': 0.33; 'something': 0.35; 'received:google.com': 0.35; 'google': 0.35; 'there': 0.35; 'activate': 0.36; 'doing': 0.36; 'unit': 0.37; 'skip:& 10': 0.38; 'sum': 0.64; 'more': 0.64; 'to:addr:gmail.com': 0.65; '20,': 0.68
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=p/CcHTNgedNlgp3NgBpW3IZz99x7UqpLSOo3iCpU8wY=; b=ATO4OpQUWU4iJ+uTZaK25NQlPC36IIfXBeeykWmVUxgdU6XSliSendrPpQX0+Sl4rW biIqjY1prO39hDTdZsMURnE4oY9PsQ47qtrjp6NtBen9Ax4Ol1BEfJW5tBTfTg6dBja9 NN13ANT2nt0k3LRJrUQ2vAULrBOhzE2HG2k6KMML1Uzg/jCdbPWNIqGD/dAdbPGTcjKW lM0MA8OPbK352w7dcXr6v9/dFRQsby4f7LvuZYtjb/5zrjK/Bl4/VzJIMg9T5srWBXw0 WwfqoTahvE2krYh+2cLIgpu+Z68iIEKBaswl8N/r81U+LPnYkw6x3xPizac3aZHMpNjb D0QA==
MIME-Version 1.0
X-Received by 10.50.33.73 with SMTP id p9mr12867143igi.24.1408543101518; Wed, 20 Aug 2014 06:58:21 -0700 (PDT)
Sender skip.montanaro@gmail.com
In-Reply-To <CAPTjJmpP2QP1Gbyj1M-EqoChiXbzOy=kTB5uLfMn4Tn9ePPOYg@mail.gmail.com>
References <CANc-5UwMj5-qvJ9qvXbJYmGPMH=p5RO2Bt98Y8aia5ce=ke5RQ@mail.gmail.com> <CAPTjJmpP2QP1Gbyj1M-EqoChiXbzOy=kTB5uLfMn4Tn9ePPOYg@mail.gmail.com>
Date Wed, 20 Aug 2014 08:58:21 -0500
X-Google-Sender-Auth 0y9MwRqkd7s28L-d5OIjvV2l_e8
Subject Re: MacroPy tracing not working for me...
From Skip Montanaro <skip@pobox.com>
To Chris Angelico <rosuav@gmail.com>
Content-Type multipart/alternative; boundary=089e01538e5a3788e405010fffd9
Cc Python <python-list@python.org>
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.13207.1408543110.18130.python-list@python.org> (permalink)
Lines 91
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1408543110 news.xs4all.nl 2918 [2001:888:2000:d::a6]:51910
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:76663

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

On Wed, Aug 20, 2014 at 7:03 AM, Chris Angelico <rosuav@gmail.com> wrote:

> Sounds like something to raise as an issue.


I found the macropy Google Group and asked there. There is more to do to
activate it. In particular, it doesn't appear-to-operate on a
less-than-module level. Since it operates on the AST, it has to be active
during byte compilation. At the REPL you can import macropy.console to
achieve the necessary activation:

>>> import macropy.console
0=[]=====> MacroPy Enabled <=====[]=0
>>> from macropy.tracing import macros, trace
>>> with trace:
...   sum = 0
...   for i in range(0, 5):
...     sum = sum + 5
...
sum = 0
for i in range(0, 5):
  sum = sum + 5
range(0, 5) -> [0, 1, 2, 3, 4]
sum = sum + 5
sum + 5 -> 5
sum = sum + 5
sum + 5 -> 10
sum = sum + 5
sum + 5 -> 15
sum = sum + 5
sum + 5 -> 20
sum = sum + 5
sum + 5 -> 25

Still haven't figured out where to import macropy.activate when I just want
to trace a single function in a larger program. I wanted to trace the
execution of a single failing unit test. It looks like I will have to
import the macropy.activate module somewhere at the top level. Perhaps I
can coax nose into doing that for me.

Skip

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


Thread

Re: MacroPy tracing not working for me... Skip Montanaro <skip@pobox.com> - 2014-08-20 08:58 -0500

csiph-web