Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #58396 > unrolled thread
| Started by | Chris Angelico <rosuav@gmail.com> |
|---|---|
| First post | 2013-11-04 00:22 +1100 |
| Last post | 2013-11-04 00:22 +1100 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Debugging decorator Chris Angelico <rosuav@gmail.com> - 2013-11-04 00:22 +1100
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2013-11-04 00:22 +1100 |
| Subject | Re: Debugging decorator |
| Message-ID | <mailman.1983.1383484938.18130.python-list@python.org> |
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 top | Article view | comp.lang.python
csiph-web