From af5e0fa2aac6504846fad96f212243f70edfe8ff Mon Sep 17 00:00:00 2001 From: nulano Date: Thu, 9 Jul 2020 23:20:45 +0200 Subject: [PATCH 1/3] add Python stdlib intersphinx mapping --- docs/conf.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/conf.py b/docs/conf.py index c700fff79..ddfb24fe3 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -34,6 +34,8 @@ extensions = [ "sphinx_removed_in", ] +intersphinx_mapping = {"python": ("https://docs.python.org/3", None)} + # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: # source_suffix = ['.rst', '.md'] From 09a87161a240d84cf20e02b6ef6faea0172d8c01 Mon Sep 17 00:00:00 2001 From: nulano Date: Thu, 9 Jul 2020 23:46:28 +0200 Subject: [PATCH 2/3] fix sys.stdout reference --- src/PIL/PSDraw.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PIL/PSDraw.py b/src/PIL/PSDraw.py index 762d31e88..a080ce44d 100644 --- a/src/PIL/PSDraw.py +++ b/src/PIL/PSDraw.py @@ -26,7 +26,7 @@ from . import EpsImagePlugin class PSDraw: """ Sets up printing to the given file. If **fp** is omitted, - :py:attr:`sys.stdout` is assumed. + :py:data:`sys.stdout` is assumed. """ def __init__(self, fp=None): From 9589159585e996e75dd47c7155635043a31cffca Mon Sep 17 00:00:00 2001 From: nulano Date: Thu, 9 Jul 2020 23:50:57 +0200 Subject: [PATCH 3/3] use cross-reference for None value --- docs/handbook/image-file-formats.rst | 2 +- docs/handbook/writing-your-own-file-decoder.rst | 2 +- docs/reference/Image.rst | 4 ++-- docs/reference/ImageDraw.rst | 2 +- docs/reference/ImageGrab.rst | 2 +- docs/releasenotes/5.3.0.rst | 2 +- docs/releasenotes/7.0.0.rst | 4 ++-- docs/releasenotes/7.1.0.rst | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/handbook/image-file-formats.rst b/docs/handbook/image-file-formats.rst index 6bcff7135..3daa75c96 100644 --- a/docs/handbook/image-file-formats.rst +++ b/docs/handbook/image-file-formats.rst @@ -857,7 +857,7 @@ The :py:meth:`~PIL.Image.Image.save` method can take the following keyword argum **compression** A string containing the desired compression method for the file. (valid only with libtiff installed) Valid compression - methods are: ``None``, ``"tiff_ccitt"``, ``"group3"``, + methods are: :data:`None`, ``"tiff_ccitt"``, ``"group3"``, ``"group4"``, ``"tiff_jpeg"``, ``"tiff_adobe_deflate"``, ``"tiff_thunderscan"``, ``"tiff_deflate"``, ``"tiff_sgilog"``, ``"tiff_sgilog24"``, ``"tiff_raw_16"`` diff --git a/docs/handbook/writing-your-own-file-decoder.rst b/docs/handbook/writing-your-own-file-decoder.rst index 89d0e3e9f..2a546b0c6 100644 --- a/docs/handbook/writing-your-own-file-decoder.rst +++ b/docs/handbook/writing-your-own-file-decoder.rst @@ -132,7 +132,7 @@ The fields are used as follows: **parameters** Parameters to the decoder. The contents of this field depends on the decoder specified by the first field in the tile descriptor tuple. If the - decoder doesn’t need any parameters, use ``None`` for this field. + decoder doesn’t need any parameters, use :data:`None` for this field. Note that the :py:attr:`tile` attribute contains a list of tile descriptors, not just a single descriptor. diff --git a/docs/reference/Image.rst b/docs/reference/Image.rst index 6fe499036..347c57688 100644 --- a/docs/reference/Image.rst +++ b/docs/reference/Image.rst @@ -285,7 +285,7 @@ Instances of the :py:class:`Image` class have the following attributes: The file format of the source file. For images created by the library itself (via a factory function, or by running a method on an existing - image), this attribute is set to ``None``. + image), this attribute is set to :data:`None`. .. py:attribute:: Image.mode :type: str @@ -314,7 +314,7 @@ Instances of the :py:class:`Image` class have the following attributes: Colour palette table, if any. If mode is "P" or "PA", this should be an instance of the :py:class:`~PIL.ImagePalette.ImagePalette` class. - Otherwise, it should be set to ``None``. + Otherwise, it should be set to :data:`None`. .. py:attribute:: Image.info :type: dict diff --git a/docs/reference/ImageDraw.rst b/docs/reference/ImageDraw.rst index fd74b69c1..3faa0d3e0 100644 --- a/docs/reference/ImageDraw.rst +++ b/docs/reference/ImageDraw.rst @@ -212,7 +212,7 @@ Methods .. versionadded:: 1.1.5 .. note:: This option was broken until version 1.1.6. - :param joint: Joint type between a sequence of lines. It can be ``"curve"``, for rounded edges, or ``None``. + :param joint: Joint type between a sequence of lines. It can be ``"curve"``, for rounded edges, or :data:`None`. .. versionadded:: 5.3.0 diff --git a/docs/reference/ImageGrab.rst b/docs/reference/ImageGrab.rst index a9427be9c..ac83b2255 100644 --- a/docs/reference/ImageGrab.rst +++ b/docs/reference/ImageGrab.rst @@ -27,7 +27,7 @@ or the clipboard to a PIL image memory. .. versionadded:: 6.2.0 :param xdisplay: - X11 Display address. Pass ``None`` to grab the default system screen. Pass ``""`` to grab the default X11 screen on Windows or macOS. + X11 Display address. Pass :data:`None` to grab the default system screen. Pass ``""`` to grab the default X11 screen on Windows or macOS. You can check X11 support using :py:func:`PIL.features.check_feature` with ``feature="xcb"``. diff --git a/docs/releasenotes/5.3.0.rst b/docs/releasenotes/5.3.0.rst index cce671c32..bff56566b 100644 --- a/docs/releasenotes/5.3.0.rst +++ b/docs/releasenotes/5.3.0.rst @@ -34,7 +34,7 @@ Curved joints for line sequences ``ImageDraw.Draw.line`` draws a line, or lines, between points. Previously, when multiple points are given, for a larger ``width``, the joints between these lines looked unsightly. There is now an additional optional argument, -``joint``, defaulting to ``None``. When it is set to ``curved``, the joints +``joint``, defaulting to :data:`None`. When it is set to ``curved``, the joints between the lines will become rounded. ImageOps.colorize diff --git a/docs/releasenotes/7.0.0.rst b/docs/releasenotes/7.0.0.rst index 73c44275c..80002b0ce 100644 --- a/docs/releasenotes/7.0.0.rst +++ b/docs/releasenotes/7.0.0.rst @@ -66,7 +66,7 @@ See :ref:`concept-filters` to learn the difference. In short, Image.draft() return value ^^^^^^^^^^^^^^^^^^^^^^^^^^ -If the :py:meth:`~PIL.Image.Image.draft` method has no effect, it returns ``None``. +If the :py:meth:`~PIL.Image.Image.draft` method has no effect, it returns :data:`None`. If it does have an effect, then it previously returned the image itself. However, unlike other `chain methods`_, :py:meth:`~PIL.Image.Image.draft` does not return a modified version of the image, but modifies it in-place. So instead, if @@ -95,7 +95,7 @@ the closer the result to the fair resampling. The smaller ``reducing_gap``, the faster resizing. With ``reducing_gap`` greater or equal to 3.0, the result is indistinguishable from fair resampling. -The default value for :py:meth:`~PIL.Image.Image.resize` is ``None``, +The default value for :py:meth:`~PIL.Image.Image.resize` is :data:`None`, which means that the optimization is turned off by default. The default value for :py:meth:`~PIL.Image.Image.thumbnail` is 2.0, diff --git a/docs/releasenotes/7.1.0.rst b/docs/releasenotes/7.1.0.rst index 55a970c1e..35e5c4464 100644 --- a/docs/releasenotes/7.1.0.rst +++ b/docs/releasenotes/7.1.0.rst @@ -63,7 +63,7 @@ Support has been added for ``ImageGrab.grab()`` on Linux using the X server with the XCB library. An optional ``xdisplay`` parameter has been added to select the X server, -with the default value of ``None`` using the default X server. +with the default value of :data:`None` using the default X server. Passing a different value on Windows or macOS will force taking a snapshot using the selected X server; pass an empty string to use the default X server.