1. Vinay Sajip
  2. docs-distlib

Commits

Vinay Sajip  committed f29b0a4

Routine update.

  • Participants
  • Parent commits 37c01e9
  • Branches default

Comments (0)

Files changed (1)

File docs/tutorial.rst

View file
 However, you can't mix and match versions of different types::
 
     >>> from distlib.version import SemanticVersion, LegacyVersion
-    >>> nv = NormalizedVersion('1.0')
     >>> nv = NormalizedVersion('1.0.0')
     >>> lv = LegacyVersion('1.0.0')
     >>> sv = SemanticVersion('1.0.0')
       File "distlib/version.py", line 58, in _check_compatible
         raise TypeError('cannot compare %r and %r' % (self, other))
     TypeError: cannot compare LegacyVersion('1.0.0') and SemanticVersion('1.0.0')
-    >>> lv == sv
+    >>> nv == sv
     Traceback (most recent call last):
       File "<stdin>", line 1, in <module>
       File "distlib/version.py", line 61, in __eq__
         self._check_compatible(other)
       File "distlib/version.py", line 58, in _check_compatible
         raise TypeError('cannot compare %r and %r' % (self, other))
-    TypeError: cannot compare LegacyVersion('1.0.0') and SemanticVersion('1.0.0')
+    TypeError: cannot compare NormalizedVersion('1.0.0') and SemanticVersion('1.0.0')
 
 
 Using the locators API
 The reason why some of the download URLs come up as UNKNOWN is that some of
 the PyPI metadata is incomplete.
 
+Locators also have a method, :meth:`get_distribution_names`, which returns a
+set of all the distribution names known to that locator instance. Note that
+the base :class:`Locator` and :class:`JSONLocator` classes don't implement this
+method, so they will raise a :class:`NotImplementedError`.
+
 The ``locators`` package also contains a function,
 :func:`get_all_distribution_names`, which retrieves the names of all
 distributions registered on PyPI::