@@ -658,7 +658,6 @@ \section{Other Language Changes}
658658
659659\end {itemize }
660660
661-
662661% ======================================================================
663662\section {New and Improved Modules }
664663
@@ -987,9 +986,9 @@ \section{Build and C API Changes}
987986when running Python's \file {configure} script. (Contributed by Ondrej
988987Palkovsky.)
989988
990- \item The \csimplemacro {DL_EXPORT} and \csimplemacro {DL_IMPORT} macros are now
991- deprecated. Initialization functions for Python extension modules
992- should now be declared using the new macro
989+ \item The \csimplemacro {DL_EXPORT} and \csimplemacro {DL_IMPORT} macros
990+ are now deprecated. Initialization functions for Python extension
991+ modules should now be declared using the new macro
993992\csimplemacro {PyMODINIT_FUNC}, while the Python core will generally
994993use the \csimplemacro {PyAPI_FUNC} and \csimplemacro {PyAPI_DATA}
995994macros.
@@ -1076,6 +1075,29 @@ \section{Other Changes and Fixes}
10761075\item The tools used to build the documentation now work under Cygwin
10771076as well as \UNIX .
10781077
1078+ \item The \code {SET_LINENO} opcode has been removed. Back in the
1079+ mists of time, this opcode was needed to produce line numbers in
1080+ tracebacks and support trace functions (for, e.g., \module {pdb}).
1081+ Since Python 1.5, the line numbers in tracebacks have been computed
1082+ using a different mechanism that works with `` python -O'' . For Python
1083+ 2.3 Michael Hudson implemented a similar scheme to determine when to
1084+ call the trace function, removing the need for \code {SET_LINENO}
1085+ entirely.
1086+
1087+ Python code will be hard pushed to notice a difference from this
1088+ change, apart from a slight speed up when python is run without
1089+ \programopt {-O}.
1090+
1091+ C extensions that access the \member {f_lineno} field of frame objects
1092+ should instead call \code {PyCode_Addr2Line(f->f_code, f->f_lasti)}.
1093+ This will have the added effect of making the code work as desired
1094+ under `` python -O'' in earlier versions of Python.
1095+
1096+ To make tracing work as expected, it was found necessary to add a new
1097+ opcode, \cdata {RETURN_NONE}, to the VM. If you want to know why, read
1098+ the comments in the function \cfunction {maybe_call_line_trace} in
1099+ \file {Python/ceval.c}.
1100+
10791101\end {itemize }
10801102
10811103
0 commit comments