diff options
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/pdb.rst | 6 | ||||
-rw-r--r-- | Doc/whatsnew/3.4.rst | 16 |
2 files changed, 19 insertions, 3 deletions
diff --git a/Doc/library/pdb.rst b/Doc/library/pdb.rst index f4e37ac..66a78d0 100644 --- a/Doc/library/pdb.rst +++ b/Doc/library/pdb.rst @@ -41,7 +41,7 @@ of the debugger is:: .. versionchanged:: 3.3 Tab-completion via the :mod:`readline` module is available for commands and command arguments, e.g. the current global and local names are offered as - arguments of the ``print`` command. + arguments of the ``p`` command. :file:`pdb.py` can also be invoked as a script to debug other scripts. For example:: @@ -309,7 +309,7 @@ by the local file. ``end`` to terminate the commands. An example:: (Pdb) commands 1 - (com) print some_variable + (com) p some_variable (com) end (Pdb) @@ -409,7 +409,7 @@ by the local file. .. pdbcommand:: pp expression - Like the :pdbcmd:`print` command, except the value of the expression is + Like the :pdbcmd:`p` command, except the value of the expression is pretty-printed using the :mod:`pprint` module. .. pdbcommand:: whatis expression diff --git a/Doc/whatsnew/3.4.rst b/Doc/whatsnew/3.4.rst index ed4ea17..373f8de 100644 --- a/Doc/whatsnew/3.4.rst +++ b/Doc/whatsnew/3.4.rst @@ -302,6 +302,22 @@ descriptors or a Windows handle: * :func:`os.get_handle_inheritable`, :func:`os.set_handle_inheritable` +pdb +--- + +The ``print`` command has been removed from :mod:`pdb`, restoring access to the +``print`` function. + +Rationale: Python2's ``pdb`` did not have a ``print`` command; instead, +entering ``print`` executed the ``print`` statement. In Python3 ``print`` was +mistakenly made an alias for the pdb :pdbcmd:`p` command. ``p``, however, +prints the ``repr`` of its argument, not the ``str`` like the Python2 ``print`` +command did. Worse, the Python3 ``pdb print`` command shadowed the Python3 +``print`` function, making it inaccessible at the ``pdb`` prompt. + +(Contributed by Connor Osborn in :issue:`18764`.) + + poplib ------ |