@@ -384,8 +384,14 @@ are always available. They are listed here in alphabetical order.
384384 It is needed to unambiguous :ref: `filter <warning-filter >` syntax warnings
385385 by module name.
386386
387- This function raises :exc: `SyntaxError ` or :exc: `ValueError ` if the compiled
388- source is invalid.
387+ This function raises :exc: `SyntaxError ` if the compiled source is invalid,
388+ including a *source * containing a null character or that cannot be decoded;
389+ :exc: `ValueError ` if *mode * or *flags * is invalid,
390+ or if a string *source * contains surrogate characters;
391+ :exc: `MemoryError ` or :exc: `RecursionError ` if *source * is too complex
392+ to parse or compile,
393+ for example an expression with many thousands of nested operators;
394+ and :exc: `OverflowError ` if *source * is too large.
389395
390396 If you want to parse Python code into its AST representation, see
391397 :func: `ast.parse `.
@@ -417,11 +423,15 @@ are always available. They are listed here in alphabetical order.
417423 Previously, :exc: `TypeError ` was raised when null bytes were encountered
418424 in *source *.
419425
420- .. versionadded :: 3.8
426+ .. versionchanged :: 3.8
421427 ``ast.PyCF_ALLOW_TOP_LEVEL_AWAIT `` can now be passed in flags to enable
422428 support for top-level ``await ``, ``async for ``, and ``async with ``.
423429
424- .. versionadded :: 3.15
430+ .. versionchanged :: 3.12
431+ :exc: `SyntaxError ` is raised instead of :exc: `ValueError ` when null bytes
432+ are encountered in *source *.
433+
434+ .. versionchanged :: 3.15
425435 Added the *module * parameter.
426436
427437
0 commit comments