This argument has no effect when copying files on Windows (where
metadata is always preserved).
- .. versionadded:: 3.14
+ .. versionadded:: next
.. method:: Path.copy_into(target_dir, *, follow_symlinks=True, \
:meth:`Path.copy`. Returns a new :class:`!Path` instance pointing to the
copy.
- .. versionadded:: 3.14
+ .. versionadded:: next
.. method:: Path.rename(target)
Return ``True`` if the symbol is a type parameter.
- .. versionadded:: 3.14
+ .. versionadded:: next
.. method:: is_global()
be free from the perspective of ``C.method``, thereby allowing
the latter to return *1* at runtime and not *2*.
- .. versionadded:: 3.14
+ .. versionadded:: next
.. method:: is_assigned()
Return ``True`` if the symbol is a comprehension iteration variable.
- .. versionadded:: 3.14
+ .. versionadded:: next
.. method:: is_comp_cell()
Return ``True`` if the symbol is a cell in an inlined comprehension.
- .. versionadded:: 3.14
+ .. versionadded:: next
.. method:: is_namespace()
return PyMethod.run(self)
-# Support for documenting version of removal in deprecations
+# Support for documenting version of changes, additions, deprecations
+
+def expand_version_arg(argument, release):
+ """Expand "next" to the current version"""
+ if argument == 'next':
+ return sphinx_gettext('{} (unreleased)').format(release)
+ return argument
+
+
+class PyVersionChange(VersionChange):
+ def run(self):
+ # Replace the 'next' special token with the current development version
+ self.arguments[0] = expand_version_arg(self.arguments[0],
+ self.config.release)
+ return super().run()
+
class DeprecatedRemoved(VersionChange):
required_arguments = 2
def run(self):
# Replace the first two arguments (deprecated version and removed version)
# with a single tuple of both versions.
- version_deprecated = self.arguments[0]
+ version_deprecated = expand_version_arg(self.arguments[0],
+ self.config.release)
version_removed = self.arguments.pop(1)
self.arguments[0] = version_deprecated, version_removed
app.add_role('gh', gh_issue_role)
app.add_directive('impl-detail', ImplementationDetail)
app.add_directive('availability', Availability)
+ app.add_directive('versionadded', PyVersionChange, override=True)
+ app.add_directive('versionchanged', PyVersionChange, override=True)
+ app.add_directive('versionremoved', PyVersionChange, override=True)
+ app.add_directive('deprecated', PyVersionChange, override=True)
app.add_directive('deprecated-removed', DeprecatedRemoved)
app.add_builder(PydocTopicsBuilder)
app.add_object_type('opcode', 'opcode', '%s (opcode)', parse_opcode_signature)