Skip to content

Commit f655175

Browse files
Fix doc for canonicalize_version to mention strip_trailing_zero and a typo in a docstring (#801)
Co-authored-by: Laurent Dufloux <[email protected]>
1 parent 886b819 commit f655175

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

docs/utils.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,12 @@ Reference
5656
>>> is_normalized_name("Django")
5757
False
5858

59-
.. function:: canonicalize_version(version)
59+
.. function:: canonicalize_version(version, strip_trailing_zero=True)
6060

6161
This function takes a string representing a package version (or a
6262
:class:`~packaging.version.Version` instance), and returns the
63-
normalized form of it.
63+
normalized form of it. By default, it strips trailing zeros from
64+
the release segment.
6465

6566
:param str version: The version to normalize.
6667

src/packaging/metadata.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ class RawMetadata(TypedDict, total=False):
167167

168168

169169
def _parse_keywords(data: str) -> list[str]:
170-
"""Split a string of comma-separate keyboards into a list of keywords."""
170+
"""Split a string of comma-separated keywords into a list of keywords."""
171171
return [k.strip() for k in data.split(",")]
172172

173173

0 commit comments

Comments
 (0)