Skip to content

Commit aaa5e91

Browse files
author
Usman Masood
committed
Don't need to slice when strigifying
1 parent 967451e commit aaa5e91

3 files changed

Lines changed: 46 additions & 159 deletions

File tree

tests/test_timeuuid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def test_descending(self):
5858
self.assertFalse(uu != duu)
5959

6060
def test_str(self):
61-
for uuid_str in get_str_uuids(10000):
61+
for uuid_str in get_str_uuids(20000):
6262
tuu = TimeUUID(uuid_str)
6363
self.assertEqual(uuid_str, str(tuu))
6464
self.assertEqual('TimeUUID(%s)' % uuid_str, repr(tuu))

timeuuid/timeuuid.c

Lines changed: 44 additions & 157 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

timeuuid/timeuuid.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ cdef class TimeUUID:
125125
def __str__(self):
126126
cdef char string[36]
127127
uuid_unparse(self._bytes, &string[0])
128-
cdef bytes py_bytes = string[:36]
128+
cdef bytes py_bytes = string
129129
return py_bytes
130130

131131
def __repr__(self):

0 commit comments

Comments
 (0)