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

IPEP 13: user-expressions and user-variables #3319

Merged
merged 7 commits into from May 31, 2013

Conversation

minrk
Copy link
Member

@minrk minrk commented May 15, 2013

The user-expressions and user-variables side effects in execute_requests are updated to use the rich-repr display data identical to a display_data message.

closes #2654

@Carreau
Copy link
Member

Carreau commented May 19, 2013

I would be carefull in merging this one as it might break on some other project. For example it breaks the ability of the qtconsole to display the list of magics in its menu.

@minrk
Copy link
Member Author

minrk commented May 19, 2013

Thanks for the pointer - I've updated that code to use JSON, which should be cleaner now that user_expressions supports full display data.

minrk added 2 commits May 19, 2013 10:28
lsmagic now uses JSON, rather than ast eval
@Carreau
Copy link
Member

Carreau commented May 19, 2013

Thanks for the pointer - I've updated that code to use JSON, which should be cleaner now that user_expressions supports full display data.

Could not just %lsmagic be updated to return multiple representation instead of creating a lsmagic_json ?

@minrk
Copy link
Member Author

minrk commented May 19, 2013

The only potential issue I see with that is that %lsmagic prints rather than returns, so it's a functional change. I think it is probably better, though. @fperez would you object to %lsmagic returning data instead of just printing it?

@Carreau
Copy link
Member

Carreau commented May 19, 2013

Also, I think this might affect emacs Ein client, and maybe spyder and canopy. Do we specifically ping those people or just let them discover?

@ccordoba12
Copy link
Member

Spyder here: We don't use %lsmagic @Carreau, but it would be better for us that it returned its data instead of printing it, so in the future we could build a web page with it to show it in our Object Inspector .

@Carreau
Copy link
Member

Carreau commented May 20, 2013

@ccordoba12 are you using user-expressions/user-variables already in some places, even if it's not for lsmagic ?

@ccordoba12
Copy link
Member

@Carreau: Nope, first time I've heard of them. What's its purpose?

@Carreau
Copy link
Member

Carreau commented May 20, 2013

Execute an expression/retrieve variable value alongside code execution in the kernel:
Explanation in the doc

That's what qtconsole use to ask the list of availlable magics in the kernel.
That's also probably what you would use if you had to implement a panel with the list of variable in the kernel.

- pretty / str representation are the regular lsmagic output
- JSON repr is just the magics dict with instances replaced with their class names in order to be jsonable.

qt magics menu population updated to reflect this.
@Carreau
Copy link
Member

Carreau commented May 31, 2013

Would it make sens to have other magics converted like that ?

@minrk
Copy link
Member Author

minrk commented May 31, 2013

Would it make sense to have other magics converted like that?

it probably would, but I don't think that's relevant to this PR.

@Carreau
Copy link
Member

Carreau commented May 31, 2013

It probably would, but I don't think that's relevant to this PR.

Just asking, just didn't wanted to open a new issue for that.

Ok to merge for me.

@minrk
Copy link
Member Author

minrk commented May 31, 2013

thanks, merging away, then.

minrk added a commit that referenced this pull request May 31, 2013
IPEP 13: user-expressions and user-variables

The user-expressions and user-variables side effects in execute_requests are updated to use the rich-repr display data identical to a display_data message.

closes #2654
@minrk minrk merged commit 2c614f3 into ipython:master May 31, 2013
@Carreau Carreau mentioned this pull request Jun 25, 2013
@minrk minrk deleted the user-expressions branch March 31, 2014 23:36
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
IPEP 13: user-expressions and user-variables

The user-expressions and user-variables side effects in execute_requests are updated to use the rich-repr display data identical to a display_data message.

closes ipython#2654
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

Successfully merging this pull request may close these issues.

User_expression issues
3 participants