As a successor of sphinx.util.inspect.Singnature, this adds
signature() function behaves like `inspect.signature()`. It is
very similar to way of python's inspect module.
In addition, this also adds stringify_annotation() helper to
sphinx.util.inspect module. With these two functions, we can move
to python's Signature object to represent function signatures
perfectly. It's natural design for python developers than ever.
https://github.com/asottile/pyupgrade
> A tool to automatically upgrade syntax for newer versions of the
> language.
- Drop u str prefix
- Drop base object inheritance
- Drop args to super()
- Use set literals
- Use dict comprehension
- Use set comprehension
In Python 3, the default encoding of source files is utf-8. The encoding
cookie is now unnecessary and redundant so remove it. For more details,
see the docs:
https://docs.python.org/3/howto/unicode.html#the-string-type
> The default encoding for Python source code is UTF-8, so you can
> simply include a Unicode character in a string literal ...
Includes a fix for the flake8 header checks to stop expecting an
encoding cookie.
Whilst working on the Reproducible Builds effort [0], we noticed
that sphinx could generate output that is not reproducible.
In particular, the rendering of `frozenset` objects in default
arguments and elsewhere is currently non-determinstic.
For example:
frozenset(['a', 'b', 'c'])
Might be rendered as any of:
frozenset({'a', 'b', 'c'})
frozenset({'a', 'c', 'b'})
frozenset({'b', 'a', 'c'})
frozenset({'b', 'c', 'a'})
frozenset({'c', 'a', 'b'})
frozenset({'c', 'b', 'a'})
Patch attached that sorts the contents of frozensets whilst rendering.
This is parallel to the `dict` and `set` type logic
[0] https://reproducible-builds.org/