From 0054e74703734a1790cc58783c9efd579bd08415 Mon Sep 17 00:00:00 2001 From: Egor Dranischnikow Date: Wed, 27 Mar 2019 23:20:49 +0100 Subject: [PATCH] adding --annotate=2 option to ipython magic --- Cython/Build/IpythonMagic.py | 4 ++-- docs/src/userguide/source_files_and_compilation.rst | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Cython/Build/IpythonMagic.py b/Cython/Build/IpythonMagic.py index 4a9f0c3d1a1..bce00305438 100644 --- a/Cython/Build/IpythonMagic.py +++ b/Cython/Build/IpythonMagic.py @@ -179,8 +179,8 @@ def f(x): @magic_arguments.magic_arguments() @magic_arguments.argument( - '-a', '--annotate', action='store_true', default=False, - help="Produce a colorized HTML version of the source." + '-a', '--annotate', nargs='?', const=1, type=int, + help="Produce a colorized HTML version of the source. Use --annotate=2 to include complete generated C/C++-code." ) @magic_arguments.argument( '-+', '--cplus', action='store_true', default=False, diff --git a/docs/src/userguide/source_files_and_compilation.rst b/docs/src/userguide/source_files_and_compilation.rst index 605b973aa5b..779a89c84c4 100644 --- a/docs/src/userguide/source_files_and_compilation.rst +++ b/docs/src/userguide/source_files_and_compilation.rst @@ -621,7 +621,7 @@ You can see them also by typing ```%%cython?`` in IPython or a Jupyter notebook. ============================================ ======================================================================================================================================= --a, --annotate Produce a colorized HTML version of the source. +-a, --annotate Produce a colorized HTML version of the source. Use ``--annotate=2`` to include the complete generated C/C++-code as well. -+, --cplus Output a C++ rather than C file. @@ -648,6 +648,7 @@ You can see them also by typing ```%%cython?`` in IPython or a Jupyter notebook. --pgo Enable profile guided optimisation in the C compiler. Compiles the cell twice and executes it in between to generate a runtime profile. --verbose Print debug information like generated .c/.cpp file location and exact gcc/g++ command invoked. + ============================================ =======================================================================================================================================