or ``2`` (docstrings are removed too).
This function raises :exc:`SyntaxError` if the compiled source is invalid,
- and :exc:`TypeError` if the source contains null bytes.
+ and :exc:`ValueError` if the source contains null bytes.
If you want to parse Python code into its AST representation, see
:func:`ast.parse`.
Allowed use of Windows and Mac newlines. Also input in ``'exec'`` mode
does not have to end in a newline anymore. Added the *optimize* parameter.
+ .. versionchanged:: 3.5
+ Previously, :exc:`TypeError` was raised when null bytes were encountered
+ in *source*.
+
.. class:: complex([real[, imag]])