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


Groups > comp.lang.python > #58387

Re: Debugging decorator

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <jsf80238@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.008
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'attribute': 0.07; 'debugging': 0.07; 'error:': 0.07; 'url:github': 0.09; 'cc:addr :python-list': 0.11; 'python': 0.11; 'wrote': 0.14; '8bit%:32': 0.16; 'skip:n 50': 0.16; 'cc:addr:python.org': 0.22; 'comparing': 0.24; 'removed.': 0.24; 'cc:2**0': 0.24; 'skip:" 30': 0.26; 'header:In-Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'getting': 0.31; 'file': 0.32; 'url:python': 0.33; '(most': 0.33; 'received:google.com': 0.35; '8bit%:9': 0.36; 'url:org': 0.36; 'skip:& 10': 0.38; 'skip:. 20': 0.38; 'url:library': 0.38; 'recent': 0.39; 'skip:& 20': 0.39; 'most': 0.60; 'url:3': 0.61; 'to:addr:gmail.com': 0.65
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 :cc:content-type; bh=o0SsPlS/d5V5VqgkLXMjH+cuTFO//hL086aT6X1KheI=; b=xqX66DZ8BFpbRA8NjNBMAQm91Um2TGlIfCd4u434YdBETnlU7dNmBVK1F3s4KPJMD6 qEBRNOWnbRFKqidL1nA+XZs158HNvVJ7aqt81fawGITPxF3h+2JFylindAg2+8vbbnRO gxM80KzW+AoTxvKWeI8b4cGvgmtWhZn5KIetDeRb/ECr3dzJk/ewo84gfKhjTthBmQBt qaxzjcQeqHHMzFQyBMlTTKI2AdL3U/GyrMNu1OPNbn92NKqL7xrmSa3vz5SfHqdBFxrQ LzSnfraq0bzZdWbE6KzglS0thCkja38tsG/B6o5IP62LOhvE4fenxlX83Y/ua2myeiEz DvCw==
MIME-Version 1.0
X-Received by 10.50.1.102 with SMTP id 6mr8566716igl.0.1383476108404; Sun, 03 Nov 2013 02:55:08 -0800 (PST)
In-Reply-To <CAFEUn8YwMwB6m9LGqsXK8iijK_DRnwv88Xxp8VP_x=Hq2TUnhQ@mail.gmail.com>
References <CAFEUn8YwMwB6m9LGqsXK8iijK_DRnwv88Xxp8VP_x=Hq2TUnhQ@mail.gmail.com>
Date Sun, 3 Nov 2013 03:55:08 -0700
Subject Re: Debugging decorator
From Jason Friedman <jsf80238@gmail.com>
To Yaşar Arabacı <yasar11732@gmail.com>
Content-Type multipart/alternative; boundary=047d7bd770a4ff2e8c04ea43a120
Cc python-list <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.1977.1383476116.18130.python-list@python.org> (permalink)
Lines 58
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1383476116 news.xs4all.nl 15923 [2001:888:2000:d::a6]:53564
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:58387

Show key headers only | View raw


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

> I wrote this decorator: https://gist.github.com/yasar11732/7163528
>
> I ran it with Python 2 and thought it was neat.
Most of my work is Python 3.
I ran 2to3-3.3 against it and I am getting this error:

$ ./simple.py
Traceback (most recent call last):
  File "./simple.py", line 3, in <module>
    @debugger.debugging
  File "/home/jason/python/debugger.py", line 41, in debugging
    new_function_body.append(make_print_node("function %s called" %
func.__name__))
  File "/home/jason/python/debugger.py", line 6, in make_print_node
    return ast.Print(dest=None, values=[ast.Str(s=s)], nl=True)
AttributeError: 'module' object has no attribute 'Print'

Comparing http://docs.python.org/2/library/ast.html#module-ast against
http://docs.python.org/3.3/library/ast.html#module-ast I see that "Print"
has indeed been removed.

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


Thread

Re: Debugging decorator Jason Friedman <jsf80238@gmail.com> - 2013-11-03 03:55 -0700

csiph-web