Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #58396
| References | <CAFEUn8YwMwB6m9LGqsXK8iijK_DRnwv88Xxp8VP_x=Hq2TUnhQ@mail.gmail.com> <CANy1k1iqXvTVY261EFc3u-FgzH4-+puMvNxahet9NAG9Bf+F8g@mail.gmail.com> <CAPTjJmqjNXc1Wf265vibZeuFNOYiBDL72TeiW2NTNjjPJjqz_A@mail.gmail.com> |
|---|---|
| Date | 2013-11-04 00:22 +1100 |
| Subject | Re: Debugging decorator |
| From | Chris Angelico <rosuav@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.1983.1383484938.18130.python-list@python.org> (permalink) |
On Mon, Nov 4, 2013 at 12:20 AM, Chris Angelico <rosuav@gmail.com> wrote: > As print is now a function, you're going to need to construct a > function call element instead of a special 'print' node. I don't know > how to do that as I'm not an AST expert, but hopefully you can work it > out from there? > > If you need it to be cross-version, you could probably use > sys.stdout.write explicitly (not forgetting to add a newline, which > print does and write - obviously - doesn't). Or just demand that "from > __future__ import print_function" be used, which will make 2.7 like > 3.3. Oh, I just noticed that the person using 2to3 wasn't the OP. My apologies, my language was aimed at the decorator's primary developer. Yasar, are you prepared to take on Python 3 support fully? If it's as simple as tweaking the Print nodes, that shouldn't be too hard (I hope). ChrisA
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: Debugging decorator Chris Angelico <rosuav@gmail.com> - 2013-11-04 00:22 +1100
csiph-web