Fix many py2-style prints in docs and commented code. (#14432)
The main interest was to transform py2-style print statements that still
appeared in some docstrings (e.g. for %history) and would thus show up
when looking at the docs either interactively or in the rendered
website. I also fixed a number of commented-out print statements at the
same time, mostly because it was easier for me to just regexp-change all
of them so that I could focus on the others.
Display Greek small letter mu (#14426)
`%time foo()` output is often copied into code comments to explain
performance improvements. The `\xb5` Latin Extended micro sign and the
`\u03bc` Greek small letter mu have different codes but often look
identical.
Output mu to align with:
* [The International System of Units (SI) brochure](
https://www.bipm.org/documents/20126/41483022/SI-Brochure-9-EN.pdf
), such as Table 7 SI prefixes
* NFKC normalized [Python code](https://peps.python.org/pep-3131/
) and [domain names](https://unicode.org/reports/tr36/). For example:
```sh
python -c 'print("""class C:
\xb5=1
print(hex(ord(dir(C)[-1])))""")' | tee /dev/fd/2 | python -
```
```python
class C:
µ=1
print(hex(ord(dir(C)[-1])))
```
`0x3bc`
* Section 2.5 Duplicated Characters of [Unicode Technical Report 25](
https://www.unicode.org/reports/tr25/)
> ...U+03BC μ is the preferred character in a Unicode context.
* Ruff confusable mapping [updates](
https://github.com/astral-sh/ruff/pull/4430/files
), currently in the "preview" stage
Add a unit test for UTF-8 display and
https://bugs.launchpad.net/ipython/+bug/348466 ASCII fallback.
Update Matplotlib docs (#14425)
This updates the docs in line with the recent changes to move Matplotlib
backend resolution to Matplotlib itself. In passing I have removed
references to things that have definitely disappeared from Matplotlib
(such as `qt4`), and I've added a comment about when
`_matplotlib_manages_backends()` can be removed in future.
This, along with #14420, should conclude the backend transition.
Fix many py2-style prints in docs and commented code.
The main interest was to transform py2-style print statements that still
appeared in some docstrings (e.g. for %history) and would thus show up
when looking at the docs either interactively or in the rendered
website. I also fixed a number of commented-out print statements at the
same time, mostly because it was easier for me to just regexp-change all
of them so that I could focus on the others.
Fix downstream ipykernel tests (#14424)
Locally I can get the downstream `ipykernel` tests to pass just by
removing the explicit downgrade of `pytest` and `pytest_asyncio`, so
here trying it in CI.
Fix listing of subcommands for "ipython profile" and "ipython history". (#14421)
The previous code (likely going back to Py2) would print
Must specify one of: dict_keys(['create', 'list', 'locate'])
This PR fixes it to
Must specify one of: 'create', 'list', 'locate'.