[Ipython-tickets] [IPython] #171: Compound statements not supported anymore in tasks?

IPython ipython-tickets@scipy....
Wed Jun 20 02:36:51 CDT 2007


#171: Compound statements not supported anymore in tasks?
--------------------+-------------------------------------------------------
 Reporter:  jitter  |       Owner:  bgranger
     Type:  defect  |      Status:  new     
 Priority:  normal  |   Milestone:          
Component:  saw     |     Version:          
 Severity:  normal  |    Keywords:          
--------------------+-------------------------------------------------------
 Hi!

 After updating to the current version of the saw branch of ipython1
 compound statements stopped working in the task farming interface. This
 looks like a regression caused by changeset 2449 (merge from core-refactor
 branch).

 How to reproduce: extend DistributedHello.py with a useless if/for/while
 statement to get a compound statement
 (http://docs.python.org/ref/compound.html) instead of a simple statement
 (http://docs.python.org/ref/simple.html), i.e.


 {{{
 -helloTaskId = rc.run(kernel.Task('time.sleep(3) ; word = "Hello,"',
 resultNames=['word']))
 +helloTaskId = rc.run(kernel.Task('if 3 < 5: time.sleep(3) ; word =
 "Hello,"', resultNames=['word']))
 }}}

 While this is syntactically valid Python code the task (of an almost
 identical example) returns with:


 {{{
 [Failure instance: Traceback (failure with no frames):
 exceptions.TypeError:
 ***************************************************************************
 An exception occurred in the IPython Interpreter due to a user action.
 This usually means that user code has a problem in it somewhere.

 engine: 3
 method: execute(lines)
 lines = if 3 < 6: print "foo" ; word = "Hello,"

 A full traceback from the actual interpreter:
 ---------------------------------------------------------------------------
 TypeError                                 Traceback (most recent call
 last)


 TypeError:
 ***************************************************************************
 }}}

 After briefly browsing the code this might be related to using lamdba
 expressions to execute those lines, because AFAIK lambda expressions may
 only contain simple statements.

 Ciao,
 jitter

-- 
Ticket URL: <http://projects.scipy.org/ipython/ipython/ticket/171>
IPython <http://ipython.scipy.org>
The IPython interactive Python system


More information about the Ipython-tickets mailing list