20 Other Changes and Fixes

#
20 Other Changes and Fixes

As usual, there were a bunch of other improvements and bugfixes scattered throughout the source tree. A search through the CVS change logs finds there were 523 patches applied and 514 bugs fixed between Python 2.2 and 2.3. Both figures are likely to be underestimates.

Some of the more notable changes are:

- If the PYTHONINSPECT environment variable is set, the Python interpreter will enter the interactive prompt after running a Python program, as if Python had been invoked with the -i option. The environment variable can be set before running the Python interpreter, or it can be set by the Python program as part of its execution.

- The regrtest.py script now provides a way to allow ``all resources except foo.'' A resource name passed to the -u option can now be prefixed with a hyphen ("`-`") to mean ``remove this resource.'' For example, the option ``-uall,-bsddb`' could be used to enable the use of all resources except `bsddb`.

- The tools used to build the documentation now work under Cygwin as well as Unix.

- The `SET_LINENO` opcode has been removed. Back in the mists of time, this opcode was needed to produce line numbers in tracebacks and support trace functions (for, e.g., `pdb`). Since Python 1.5, the line numbers in tracebacks have been computed using a different mechanism that works with ``python -O''. For Python 2.3 Michael Hudson implemented a similar scheme to determine when to call the trace function, removing the need for `SET_LINENO` entirely.

  It would be difficult to detect any resulting difference from Python code, apart from a slight speed up when Python is run without -O.

  C extensions that access the `f_lineno` field of frame objects should instead call `PyCode_Addr2Line(f->f_code, f->f_lasti)`. This will have the added effect of making the code work as desired under ``python -O'' in earlier versions of Python.

  A nifty new feature is that trace functions can now assign to the `f_lineno` attribute of frame objects, changing the line that will be executed next. A "`jump`" command has been added to the `pdb` debugger taking advantage of this new feature. (Implemented by Richie Hindle.)