"codeop" --- Compila código Python
**********************************

**Código fuente:** Lib/codeop.py

======================================================================

El módulo "codeop" proporciona herramientas para emular el bucle
principal del intérprete de Python (también conocido como read-eval-
print), tal como se hace en el módulo "code".  Por lo tanto, este
módulo no está diseñado para utilizarlo directamente; si desea incluir
un ciclo de este tipo en su programa, probablemente es mejor utilizar
el módulo "code" en su lugar.

Esta actividad consta de dos partes:

1. Being able to tell if a line of input completes a Python statement:
   in short, telling whether to print '">>>"' or '"..."' next.

2. Remembering which future statements the user has entered, so
   subsequent input can be compiled with these in effect.

El módulo "codeop" proporciona formas de realizar estas dos partes,
tanto de forma independiente, como en conjunto.

Para hacer lo anterior:

codeop.compile_command(source, filename='<input>', symbol='single')

   Tries to compile *source*, which should be a string of Python code
   and return a code object if *source* is valid Python code.  In that
   case, the filename attribute of the code object will be *filename*,
   which defaults to "'<input>'".  Returns "None" if *source* is *not*
   valid Python code, but is a prefix of valid Python code.

   Si hay un problema con *source*, se lanzará una excepción.
   "SyntaxError" se lanza si hay una sintaxis de Python no válida, y
   "OverflowError" o "ValueError" si hay un literal no válido.

   The *symbol* argument determines whether *source* is compiled as a
   statement ("'single'", the default), as a sequence of *statement*
   ("'exec'") or as an *expression* ("'eval'").  Any other value will
   cause "ValueError" to be raised.

   Nota:

     Es posible (pero no probable) que el analizador deje de analizar
     con un resultado exitoso antes de llegar al final de la fuente;
     en este caso, los símbolos finales pueden ignorarse en lugar de
     provocar un error. Por ejemplo, una barra invertida seguida de
     dos nuevas líneas puede ir seguida de basura arbitraria. Esto se
     solucionará una vez que la API para el analizador sea mejor.

class codeop.Compile

   Instances of this class have "__call__()" methods identical in
   signature to the built-in function "compile()", but with the
   difference that if the instance compiles program text containing a
   "__future__" statement, the instance 'remembers' and compiles all
   subsequent program texts with the statement in force.

class codeop.CommandCompiler

   Instances of this class have "__call__()" methods identical in
   signature to "compile_command()"; the difference is that if the
   instance compiles program text containing a "__future__" statement,
   the instance 'remembers' and compiles all subsequent program texts
   with the statement in force.
