[IPython-dev] No displayhook triggered for raw 'asdf'

Fernando Perez fperez.net at gmail.com
Thu Jan 27 16:14:21 EST 2011

On Wed, Jan 26, 2011 at 6:00 PM, Gael Varoquaux
<gael.varoquaux at normalesup.org> wrote:
> AFAIK comments and equivalent (a single string is considered as a
> comment) are not represented in the AST. I struggled with that in
> pyreport (no use to look at the pyreport code: I don't think that it is
> useable for you). I think that the way out it to use a combination of the
> tokenizer and the AST to identify such trouble makers before feeding them
> to the AST. It gets nasty.

Aha, that makes perfect sense.

>> BTW, I have no clue as to why it's not happening on the py3k branch,
>> that's quite odd.
> In py3k, I believe that the underlying notion is that of a CST: 'concrete
> syntax tree', that keeps extra information, such as the comments or
> blocks made of strings. It was introduced for code manipulations.
> I hope I haven't inserted too many factual mistakes above :)

Well, your comments are super helpful, actually.  It explains what
we're seeing, and at least gives us an idea on how to proceed...  If
nothing else, we can special-case things a little.  It may not be
pretty, but knowing what's going on at least makes it tractable.

Many thanks!


More information about the IPython-dev mailing list