[issue7741] Allow multiple statements in code.InteractiveConsole.push

2012-12-09 Thread Chris Withers
Changes by Chris Withers : -- nosy: -cjw296 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue7741] Allow multiple statements in code.InteractiveConsole.push

2012-12-09 Thread Nick Coghlan
Nick Coghlan added the comment: Good to know - I guess in most circumstances copy-and-paste already works, because the input will be arriving via a line-buffered IO stream. I was thinking that with #16649 implemented, it would be possible to simply switch from "single" to "exec", without users

[issue7741] Allow multiple statements in code.InteractiveConsole.push

2012-12-09 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Sounds fine. Just a note to my original intent in #7741: We were using the InteractiveConsole class to implement a remote web-based console for our EVE servers. Often, as a means to hot-fix certain issues, we would paste code snippets into these window

[issue7741] Allow multiple statements in code.InteractiveConsole.push

2012-12-08 Thread Nick Coghlan
Nick Coghlan added the comment: More implicit magic seems like a bad idea, so I've split out a proposal for an explicit PyCF_DISPLAY_EXPRESSION_RESULTS flag as #16649. The behaviour would then be selectable regardless of the compilation mode, but would remain the default for "single". ---

[issue7741] Allow multiple statements in code.InteractiveConsole.push

2012-12-08 Thread Aaron Iles
Aaron Iles added the comment: Should a new issue be created to decouple "print after every call" from the single vs multiple statement condition that is a blocker for this issue? Or can it be resolved here? On Sunday, 9 December 2012, Nick Coghlan wrote: > > Nick Coghlan added the comment: > >

[issue7741] Allow multiple statements in code.InteractiveConsole.push

2012-12-08 Thread Nick Coghlan
Nick Coghlan added the comment: OK, after a long detour that delved deep into codeop and the vagaries of PyCF_DONT_IMPLY_DEDENT (due to a problem that turned out to be due to a missing "\n" in a test case I added), my main conclusion is: Coupling the "single vs multiple statement" decision to

[issue7741] Allow multiple statements in code.InteractiveConsole.push

2012-08-22 Thread aliles
aliles added the comment: I agree that the second patch adds little value to InteractiveConsole. A third alternative would be to accept default grammar start symbol to be passed to __init__(). Although this would prevent mixing use of 'single' with 'exec'. --

[issue7741] Allow multiple statements in code.InteractiveConsole.push

2012-08-22 Thread Andrew Svetlov
Changes by Andrew Svetlov : -- nosy: +asvetlov ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pytho

[issue7741] Allow multiple statements in code.InteractiveConsole.push

2012-08-22 Thread Nick Coghlan
Nick Coghlan added the comment: Aaron was looking for something to work on for the PyConAU sprints, and set himself the task of closing as many issues related to the code module as possible. The main outcome of that was the new test suite added in #12643, which should make it easier to work o

[issue7741] Allow multiple statements in code.InteractiveConsole.push

2012-08-21 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: What's the purpose of the new patch, particularly 2/2 since it is equivalent to multiple push() calls? I.e. since this issue has laid dormant for two years, what prompts the sudden activity? -- ___ Python tr

[issue7741] Allow multiple statements in code.InteractiveConsole.push

2012-08-20 Thread aliles
aliles added the comment: A quick note regarding the last two patches submitted. These patches add unit tests using the test suite added for Issue #12643. This limits the patches suitable to Python 3.3 and up. -- nosy: +ncoghlan ___ Python tracker

[issue7741] Allow multiple statements in code.InteractiveConsole.push

2012-08-20 Thread aliles
aliles added the comment: Patch option 2 of 2. Alternative patch that adds a new method to InteractiveConsole to split the string into multiple lines, feeding each line to interpreter using push(). This doesn't change the behaviour regarding the displayhook. But this may not meet Kristjan's o

[issue7741] Allow multiple statements in code.InteractiveConsole.push

2012-08-20 Thread aliles
aliles added the comment: Patch option 1 of 2. Incorporates Kristjan's patch and adds unit tests. This has the side effect of changing InteractiveConsole's behaviour with respect to displayhook(). I'm unsure if this is desirable. -- nosy: +aliles Added file: http://bugs.python.org/fil

[issue7741] Allow multiple statements in code.InteractiveConsole.push

2010-08-16 Thread Éric Araujo
Changes by Éric Araujo : -- nosy: +eric.araujo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pytho

[issue7741] Allow multiple statements in code.InteractiveConsole.push

2010-01-23 Thread Chris Withers
Chris Withers added the comment: Please can you starts a small test suite for the code module that tests the fix you are proposing and include it as another patch? -- nosy: +cjw296 ___ Python tracker _

[issue7741] Allow multiple statements in code.InteractiveConsole.push

2010-01-19 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Here is how to test this manually: from code import InteractiveConsole c = InteractiveConsole() s = "if True:\n print 1\nprint 2" c.push(s) #fails c.push(s, "exec") #succeeds -- ___ Python tracker

[issue7741] Allow multiple statements in code.InteractiveConsole.push

2010-01-19 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Note, there are no regression tests for the code module. -- ___ Python tracker ___ ___ Pytho

[issue7741] Allow multiple statements in code.InteractiveConsole.push

2010-01-19 Thread Brian Curtin
Changes by Brian Curtin : -- keywords: +needs review priority: -> normal stage: -> test needed ___ Python tracker ___ ___ Python-bugs

[issue7741] Allow multiple statements in code.InteractiveConsole.push

2010-01-19 Thread Kristján Valur Jónsson
New submission from Kristján Valur Jónsson : The code.InteractiveConsole() is useful to emulate a python console. However, any code currently "push"ed to it must be single statements. This is because it passes the ´single´ symbol mode to the underlying compile function. This patch allows the