diff options
author | Berker Peksag <berker.peksag@gmail.com> | 2016-12-31 17:08:16 (GMT) |
---|---|---|
committer | Berker Peksag <berker.peksag@gmail.com> | 2016-12-31 17:08:16 (GMT) |
commit | 6b5e4a86a7f53bcdc565d1eb6d88c17d16b64a2f (patch) | |
tree | f19e1963258a91169e42528dc56c18f693fe1ec6 /Lib | |
parent | 195319e6bb605e882d942f2268dbb0408c896ee1 (diff) | |
download | cpython-6b5e4a86a7f53bcdc565d1eb6d88c17d16b64a2f.zip cpython-6b5e4a86a7f53bcdc565d1eb6d88c17d16b64a2f.tar.gz cpython-6b5e4a86a7f53bcdc565d1eb6d88c17d16b64a2f.tar.bz2 |
Issue #26267: Improve uuid.UUID documentation
* Document how comparison of UUID objects work
* Document str(uuid) returns the braceless standard form
* Add a test for comparison of a UUID object with a non-UUID object
Patch by Ammar Askar.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_uuid.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_uuid.py b/Lib/test/test_uuid.py index e34d8e6..47248f9 100644 --- a/Lib/test/test_uuid.py +++ b/Lib/test/test_uuid.py @@ -292,6 +292,10 @@ class TestUUID(unittest.TestCase): badtype(lambda: setattr(u, 'clock_seq_low', 0)) badtype(lambda: setattr(u, 'node', 0)) + # Comparison with a non-UUID object + badtype(lambda: u < object()) + badtype(lambda: u > object()) + def test_getnode(self): node1 = uuid.getnode() self.assertTrue(0 < node1 < (1 << 48), '%012x' % node1) |