Skip to content

Commit

Permalink
Don't need to slice when strigifying
Browse files Browse the repository at this point in the history
  • Loading branch information
Usman Masood committed Jul 22, 2014
1 parent 967451e commit aaa5e91
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 159 deletions.
2 changes: 1 addition & 1 deletion tests/test_timeuuid.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def test_descending(self):
self.assertFalse(uu != duu)

def test_str(self):
for uuid_str in get_str_uuids(10000):
for uuid_str in get_str_uuids(20000):
tuu = TimeUUID(uuid_str)
self.assertEqual(uuid_str, str(tuu))
self.assertEqual('TimeUUID(%s)' % uuid_str, repr(tuu))
Expand Down
201 changes: 44 additions & 157 deletions timeuuid/timeuuid.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion timeuuid/timeuuid.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ cdef class TimeUUID:
def __str__(self):
cdef char string[36]
uuid_unparse(self._bytes, &string[0])
cdef bytes py_bytes = string[:36]
cdef bytes py_bytes = string
return py_bytes

def __repr__(self):
Expand Down

0 comments on commit aaa5e91

Please sign in to comment.