Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check_complete doesn't take automagic into account #8625

Open
minrk opened this issue Jul 11, 2015 · 3 comments
Open

check_complete doesn't take automagic into account #8625

minrk opened this issue Jul 11, 2015 · 3 comments
Milestone

Comments

@minrk
Copy link
Member

minrk commented Jul 11, 2015

With automagic on:

In [1]: ip.input_transformer_manager.check_complete('cd ~')
Out[1]: ('invalid', None)

In [2]: ip.input_transformer_manager.check_complete('%cd ~')
Out[2]: ('complete', None)

Which are equivalent after prefilters, transformers have been applied.

@minrk
Copy link
Member Author

minrk commented Jul 11, 2015

I noticed this since the qtconsole now relies on this for implicit execution.

@takluyver
Copy link
Member

I think that is actually by design, though perhaps that design doesn't make sense any more. Input transformers are applied line-by-line, but prefilters are only applied when the code is run. So 'invalid' triggers an attempt to execute, and then prefilters step in and may transform it into valid code.

This distinction was useful when we were using InputSplitter in the Qt console frontend process: prefilters can use the IPython user namespace to determine what should happen, so they can't run in the frontend. Input transformers work without reference to the namespace, so they could be in the frontend. Now that we're doing the 'is complete' checks in the kernel, there's probably no need for that distinction to exist.

@minrk
Copy link
Member Author

minrk commented Jul 11, 2015

If there's a good reason, I'm okay wht that. I was just a bit surprised when I ran into it. Pretty low priority, I think.

@minrk minrk added this to the 5.0 milestone Jul 11, 2015
@Carreau Carreau modified the milestones: wishlist, 5.0 May 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants