[Python-ideas] Non-boolean return from __contains__

Terry Reedy tjreedy at udel.edu
Thu Jul 29 19:18:54 CEST 2010


On 7/27/2010 3:05 PM, Alexander Belopolsky wrote:

> anyways.  I would be very interested to see the parse() function.  It
> does not exist (yet), right?

 >>> def expr(s): return ast.parse(s, mode='eval')

 >>> e = expr('a+b')
 >>> e
<_ast.Expression object at 0x00F8DCF0>

-- 
Terry Jan Reedy




More information about the Python-ideas mailing list