ulid-transform 0.9.0__cp312-cp312-win_amd64.whl → 0.10.2__cp312-cp312-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- /* Generated by Cython 3.0.4 */
1
+ /* Generated by Cython 3.0.10 */
2
2
 
3
3
  /* BEGIN: Cython Metadata
4
4
  {
@@ -50,10 +50,10 @@ END: Cython Metadata */
50
50
  #else
51
51
  #define __PYX_EXTRA_ABI_MODULE_NAME ""
52
52
  #endif
53
- #define CYTHON_ABI "3_0_4" __PYX_EXTRA_ABI_MODULE_NAME
53
+ #define CYTHON_ABI "3_0_10" __PYX_EXTRA_ABI_MODULE_NAME
54
54
  #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
55
55
  #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
56
- #define CYTHON_HEX_VERSION 0x030004F0
56
+ #define CYTHON_HEX_VERSION 0x03000AF0
57
57
  #define CYTHON_FUTURE_DIVISION 1
58
58
  #include <stddef.h>
59
59
  #ifndef offsetof
@@ -145,6 +145,8 @@ END: Cython Metadata */
145
145
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
146
146
  #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
147
147
  #endif
148
+ #undef CYTHON_USE_FREELISTS
149
+ #define CYTHON_USE_FREELISTS 0
148
150
  #elif defined(PYPY_VERSION)
149
151
  #define CYTHON_COMPILING_IN_PYPY 1
150
152
  #define CYTHON_COMPILING_IN_CPYTHON 0
@@ -206,6 +208,8 @@ END: Cython Metadata */
206
208
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
207
209
  #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
208
210
  #endif
211
+ #undef CYTHON_USE_FREELISTS
212
+ #define CYTHON_USE_FREELISTS 0
209
213
  #elif defined(CYTHON_LIMITED_API)
210
214
  #ifdef Py_LIMITED_API
211
215
  #undef __PYX_LIMITED_VERSION_HEX
@@ -267,7 +271,9 @@ END: Cython Metadata */
267
271
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
268
272
  #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
269
273
  #endif
270
- #elif defined(PY_NOGIL)
274
+ #undef CYTHON_USE_FREELISTS
275
+ #define CYTHON_USE_FREELISTS 0
276
+ #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL)
271
277
  #define CYTHON_COMPILING_IN_PYPY 0
272
278
  #define CYTHON_COMPILING_IN_CPYTHON 0
273
279
  #define CYTHON_COMPILING_IN_LIMITED_API 0
@@ -276,11 +282,17 @@ END: Cython Metadata */
276
282
  #ifndef CYTHON_USE_TYPE_SLOTS
277
283
  #define CYTHON_USE_TYPE_SLOTS 1
278
284
  #endif
285
+ #ifndef CYTHON_USE_TYPE_SPECS
286
+ #define CYTHON_USE_TYPE_SPECS 0
287
+ #endif
279
288
  #undef CYTHON_USE_PYTYPE_LOOKUP
280
289
  #define CYTHON_USE_PYTYPE_LOOKUP 0
281
290
  #ifndef CYTHON_USE_ASYNC_SLOTS
282
291
  #define CYTHON_USE_ASYNC_SLOTS 1
283
292
  #endif
293
+ #ifndef CYTHON_USE_PYLONG_INTERNALS
294
+ #define CYTHON_USE_PYLONG_INTERNALS 0
295
+ #endif
284
296
  #undef CYTHON_USE_PYLIST_INTERNALS
285
297
  #define CYTHON_USE_PYLIST_INTERNALS 0
286
298
  #ifndef CYTHON_USE_UNICODE_INTERNALS
@@ -288,8 +300,6 @@ END: Cython Metadata */
288
300
  #endif
289
301
  #undef CYTHON_USE_UNICODE_WRITER
290
302
  #define CYTHON_USE_UNICODE_WRITER 0
291
- #undef CYTHON_USE_PYLONG_INTERNALS
292
- #define CYTHON_USE_PYLONG_INTERNALS 0
293
303
  #ifndef CYTHON_AVOID_BORROWED_REFS
294
304
  #define CYTHON_AVOID_BORROWED_REFS 0
295
305
  #endif
@@ -301,11 +311,22 @@ END: Cython Metadata */
301
311
  #endif
302
312
  #undef CYTHON_FAST_THREAD_STATE
303
313
  #define CYTHON_FAST_THREAD_STATE 0
314
+ #undef CYTHON_FAST_GIL
315
+ #define CYTHON_FAST_GIL 0
316
+ #ifndef CYTHON_METH_FASTCALL
317
+ #define CYTHON_METH_FASTCALL 1
318
+ #endif
304
319
  #undef CYTHON_FAST_PYCALL
305
320
  #define CYTHON_FAST_PYCALL 0
321
+ #ifndef CYTHON_PEP487_INIT_SUBCLASS
322
+ #define CYTHON_PEP487_INIT_SUBCLASS 1
323
+ #endif
306
324
  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
307
325
  #define CYTHON_PEP489_MULTI_PHASE_INIT 1
308
326
  #endif
327
+ #ifndef CYTHON_USE_MODULE_STATE
328
+ #define CYTHON_USE_MODULE_STATE 0
329
+ #endif
309
330
  #ifndef CYTHON_USE_TP_FINALIZE
310
331
  #define CYTHON_USE_TP_FINALIZE 1
311
332
  #endif
@@ -313,6 +334,12 @@ END: Cython Metadata */
313
334
  #define CYTHON_USE_DICT_VERSIONS 0
314
335
  #undef CYTHON_USE_EXC_INFO_STACK
315
336
  #define CYTHON_USE_EXC_INFO_STACK 0
337
+ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
338
+ #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
339
+ #endif
340
+ #ifndef CYTHON_USE_FREELISTS
341
+ #define CYTHON_USE_FREELISTS 0
342
+ #endif
316
343
  #else
317
344
  #define CYTHON_COMPILING_IN_PYPY 0
318
345
  #define CYTHON_COMPILING_IN_CPYTHON 1
@@ -403,6 +430,9 @@ END: Cython Metadata */
403
430
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
404
431
  #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
405
432
  #endif
433
+ #ifndef CYTHON_USE_FREELISTS
434
+ #define CYTHON_USE_FREELISTS 1
435
+ #endif
406
436
  #endif
407
437
  #if !defined(CYTHON_FAST_PYCCALL)
408
438
  #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
@@ -611,18 +641,19 @@ class __Pyx_FakeReference {
611
641
  PyObject *exception_table = NULL;
612
642
  PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
613
643
  #if __PYX_LIMITED_VERSION_HEX < 0x030B0000
614
- PyObject *version_info; // borrowed
615
- #endif
644
+ PyObject *version_info;
616
645
  PyObject *py_minor_version = NULL;
646
+ #endif
617
647
  long minor_version = 0;
618
648
  PyObject *type, *value, *traceback;
619
649
  PyErr_Fetch(&type, &value, &traceback);
620
650
  #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000
621
- minor_version = 11; // we don't yet need to distinguish between versions > 11
651
+ minor_version = 11;
622
652
  #else
623
653
  if (!(version_info = PySys_GetObject("version_info"))) goto end;
624
654
  if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end;
625
655
  minor_version = PyLong_AsLong(py_minor_version);
656
+ Py_DECREF(py_minor_version);
626
657
  if (minor_version == -1 && PyErr_Occurred()) goto end;
627
658
  #endif
628
659
  if (!(types_module = PyImport_ImportModule("types"))) goto end;
@@ -643,7 +674,6 @@ class __Pyx_FakeReference {
643
674
  Py_XDECREF(code_type);
644
675
  Py_XDECREF(exception_table);
645
676
  Py_XDECREF(types_module);
646
- Py_XDECREF(py_minor_version);
647
677
  if (type) {
648
678
  PyErr_Restore(type, value, traceback);
649
679
  }
@@ -676,7 +706,7 @@ class __Pyx_FakeReference {
676
706
  PyObject *fv, PyObject *cell, PyObject* fn,
677
707
  PyObject *name, int fline, PyObject *lnos) {
678
708
  PyCodeObject *result;
679
- PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); // we don't have access to __pyx_empty_bytes here
709
+ PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0);
680
710
  if (!empty_bytes) return NULL;
681
711
  result =
682
712
  #if PY_VERSION_HEX >= 0x030C0000
@@ -762,8 +792,13 @@ class __Pyx_FakeReference {
762
792
  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
763
793
  Py_ssize_t nargs, PyObject *kwnames);
764
794
  #else
765
- #define __Pyx_PyCFunctionFast _PyCFunctionFast
766
- #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
795
+ #if PY_VERSION_HEX >= 0x030d00A4
796
+ # define __Pyx_PyCFunctionFast PyCFunctionFast
797
+ # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
798
+ #else
799
+ # define __Pyx_PyCFunctionFast _PyCFunctionFast
800
+ # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
801
+ #endif
767
802
  #endif
768
803
  #if CYTHON_METH_FASTCALL
769
804
  #define __Pyx_METH_FASTCALL METH_FASTCALL
@@ -838,6 +873,8 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) {
838
873
  #define __Pyx_PyThreadState_Current PyThreadState_Get()
839
874
  #elif !CYTHON_FAST_THREAD_STATE
840
875
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
876
+ #elif PY_VERSION_HEX >= 0x030d00A1
877
+ #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
841
878
  #elif PY_VERSION_HEX >= 0x03060000
842
879
  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
843
880
  #elif PY_VERSION_HEX >= 0x03000000
@@ -913,7 +950,7 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
913
950
  }
914
951
  #endif
915
952
  #endif
916
- #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
953
+ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized)
917
954
  #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
918
955
  #else
919
956
  #define __Pyx_PyDict_NewPresized(n) PyDict_New()
@@ -925,7 +962,7 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
925
962
  #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
926
963
  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
927
964
  #endif
928
- #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && CYTHON_USE_UNICODE_INTERNALS
965
+ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS
929
966
  #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
930
967
  static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
931
968
  PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
@@ -969,7 +1006,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict,
969
1006
  #endif
970
1007
  #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000
971
1008
  #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\
972
- PyTypeObject *type = Py_TYPE(obj);\
1009
+ PyTypeObject *type = Py_TYPE((PyObject*)obj);\
973
1010
  assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
974
1011
  PyObject_GC_Del(obj);\
975
1012
  Py_DECREF(type);\
@@ -1113,6 +1150,15 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict,
1113
1150
  #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
1114
1151
  #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
1115
1152
  #endif
1153
+ #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
1154
+ #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
1155
+ #else
1156
+ static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
1157
+ PyObject *module = PyImport_AddModule(name);
1158
+ Py_XINCREF(module);
1159
+ return module;
1160
+ }
1161
+ #endif
1116
1162
  #if PY_MAJOR_VERSION >= 3
1117
1163
  #define PyIntObject PyLongObject
1118
1164
  #define PyInt_Type PyLong_Type
@@ -1191,7 +1237,7 @@ static CYTHON_INLINE float __PYX_NAN() {
1191
1237
  #endif
1192
1238
 
1193
1239
  #define __PYX_MARK_ERR_POS(f_index, lineno) \
1194
- { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
1240
+ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
1195
1241
  #define __PYX_ERR(f_index, lineno, Ln_error) \
1196
1242
  { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
1197
1243
 
@@ -1297,24 +1343,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
1297
1343
  #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
1298
1344
  #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
1299
1345
  #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
1300
- #if CYTHON_COMPILING_IN_LIMITED_API
1301
- static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u)
1302
- {
1303
- const wchar_t *u_end = u;
1304
- while (*u_end++) ;
1305
- return (size_t)(u_end - u - 1);
1306
- }
1307
- #else
1308
- static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
1309
- {
1310
- const Py_UNICODE *u_end = u;
1311
- while (*u_end++) ;
1312
- return (size_t)(u_end - u - 1);
1313
- }
1314
- #endif
1315
1346
  #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o)
1316
- #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
1317
- #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
1318
1347
  #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
1319
1348
  #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
1320
1349
  #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
@@ -1364,7 +1393,7 @@ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
1364
1393
  #endif
1365
1394
  typedef Py_ssize_t __Pyx_compact_pylong;
1366
1395
  typedef size_t __Pyx_compact_upylong;
1367
- #else // Py < 3.12
1396
+ #else
1368
1397
  #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0)
1369
1398
  #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0)
1370
1399
  #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0)
@@ -1670,8 +1699,8 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int
1670
1699
  #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg)
1671
1700
  #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg)
1672
1701
  #else
1673
- #define __Pyx_Arg_NewRef_VARARGS(arg) arg // no-op
1674
- #define __Pyx_Arg_XDECREF_VARARGS(arg) // no-op - arg is borrowed
1702
+ #define __Pyx_Arg_NewRef_VARARGS(arg) arg
1703
+ #define __Pyx_Arg_XDECREF_VARARGS(arg)
1675
1704
  #endif
1676
1705
  #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
1677
1706
  #define __Pyx_KwValues_VARARGS(args, nargs) NULL
@@ -1682,9 +1711,14 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int
1682
1711
  #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds)
1683
1712
  #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
1684
1713
  static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s);
1714
+ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
1715
+ CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues);
1716
+ #else
1685
1717
  #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
1686
- #define __Pyx_Arg_NewRef_FASTCALL(arg) arg // no-op, __Pyx_Arg_FASTCALL is direct and this needs
1687
- #define __Pyx_Arg_XDECREF_FASTCALL(arg) // no-op - arg was returned from array
1718
+ #endif
1719
+ #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs
1720
+ to have the same reference counting */
1721
+ #define __Pyx_Arg_XDECREF_FASTCALL(arg)
1688
1722
  #else
1689
1723
  #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS
1690
1724
  #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
@@ -1810,27 +1844,9 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObjec
1810
1844
  /* RaiseException.proto */
1811
1845
  static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1812
1846
 
1813
- /* PyObjectFormatSimple.proto */
1814
- #if CYTHON_COMPILING_IN_PYPY
1815
- #define __Pyx_PyObject_FormatSimple(s, f) (\
1816
- likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
1817
- PyObject_Format(s, f))
1818
- #elif PY_MAJOR_VERSION < 3
1819
- #define __Pyx_PyObject_FormatSimple(s, f) (\
1820
- likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
1821
- likely(PyString_CheckExact(s)) ? PyUnicode_FromEncodedObject(s, NULL, "strict") :\
1822
- PyObject_Format(s, f))
1823
- #elif CYTHON_USE_TYPE_SLOTS
1824
- #define __Pyx_PyObject_FormatSimple(s, f) (\
1825
- likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
1826
- likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_repr(s) :\
1827
- likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_repr(s) :\
1828
- PyObject_Format(s, f))
1829
- #else
1830
- #define __Pyx_PyObject_FormatSimple(s, f) (\
1831
- likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
1832
- PyObject_Format(s, f))
1833
- #endif
1847
+ /* PyObjectFormatAndDecref.proto */
1848
+ static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f);
1849
+ static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f);
1834
1850
 
1835
1851
  /* MoveIfSupported.proto */
1836
1852
  #if CYTHON_USE_CPP_STD_MOVE
@@ -1944,7 +1960,7 @@ typedef struct {
1944
1960
  #endif
1945
1961
  void *defaults;
1946
1962
  int defaults_pyobjects;
1947
- size_t defaults_size; // used by FusedFunction for copying defaults
1963
+ size_t defaults_size;
1948
1964
  int flags;
1949
1965
  PyObject *defaults_tuple;
1950
1966
  PyObject *defaults_kwdict;
@@ -2150,12 +2166,12 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2150
2166
  /* Module declarations from "cython" */
2151
2167
 
2152
2168
  /* Module declarations from "ulid_transform._ulid_impl" */
2153
- static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_string(std::string const &); /*proto*/
2154
- static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_string(std::string const &); /*proto*/
2155
- static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(std::string const &); /*proto*/
2156
- static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string(std::string const &); /*proto*/
2157
- static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_string(std::string const &); /*proto*/
2158
- static std::string __pyx_convert_string_from_py_std__in_string(PyObject *); /*proto*/
2169
+ static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string(std::string const &); /*proto*/
2170
+ static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(std::string const &); /*proto*/
2171
+ static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string(std::string const &); /*proto*/
2172
+ static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(std::string const &); /*proto*/
2173
+ static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string(std::string const &); /*proto*/
2174
+ static std::string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(PyObject *); /*proto*/
2159
2175
  /* #### Code section: typeinfo ### */
2160
2176
  /* #### Code section: before_global_var ### */
2161
2177
  #define __Pyx_MODULE_NAME "ulid_transform._ulid_impl"
@@ -2167,7 +2183,7 @@ int __pyx_module_is_main_ulid_transform___ulid_impl = 0;
2167
2183
  static PyObject *__pyx_builtin_ValueError;
2168
2184
  /* #### Code section: string_decls ### */
2169
2185
  static const char __pyx_k_[] = ".";
2170
- static const char __pyx_k__9[] = "?";
2186
+ static const char __pyx_k__11[] = "?";
2171
2187
  static const char __pyx_k_str[] = "str";
2172
2188
  static const char __pyx_k_main[] = "__main__";
2173
2189
  static const char __pyx_k_name[] = "__name__";
@@ -2178,18 +2194,24 @@ static const char __pyx_k_float[] = "float";
2178
2194
  static const char __pyx_k_import[] = "__import__";
2179
2195
  static const char __pyx_k_return[] = "return";
2180
2196
  static const char __pyx_k_time_2[] = "time";
2197
+ static const char __pyx_k_typing[] = "typing";
2198
+ static const char __pyx_k_Optional[] = "Optional";
2181
2199
  static const char __pyx_k_ulid_now[] = "_ulid_now";
2182
2200
  static const char __pyx_k_ulid_str[] = "ulid_str";
2183
2201
  static const char __pyx_k_ValueError[] = "ValueError";
2184
2202
  static const char __pyx_k_ulid_bytes[] = "ulid_bytes";
2203
+ static const char __pyx_k_Optional_str[] = "Optional[str]";
2185
2204
  static const char __pyx_k_is_coroutine[] = "_is_coroutine";
2186
2205
  static const char __pyx_k_ulid_at_time[] = "_ulid_at_time";
2187
2206
  static const char __pyx_k_bytes_to_ulid[] = "_bytes_to_ulid";
2188
2207
  static const char __pyx_k_ulid_to_bytes[] = "_ulid_to_bytes";
2208
+ static const char __pyx_k_Optional_bytes[] = "Optional[bytes]";
2189
2209
  static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines";
2190
2210
  static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2191
- static const char __pyx_k_ULID_bytes_be_16_bytes[] = "ULID bytes be 16 bytes: ";
2211
+ static const char __pyx_k_bytes_to_ulid_or_none[] = "_bytes_to_ulid_or_none";
2212
+ static const char __pyx_k_ulid_to_bytes_or_none[] = "_ulid_to_bytes_or_none";
2192
2213
  static const char __pyx_k_ulid_transform__ulid_impl[] = "ulid_transform._ulid_impl";
2214
+ static const char __pyx_k_ULID_bytes_must_be_16_bytes[] = "ULID bytes must be 16 bytes: ";
2193
2215
  static const char __pyx_k_ULID_must_be_a_26_character_stri[] = "ULID must be a 26 character string: ";
2194
2216
  static const char __pyx_k_src_ulid_transform__ulid_impl_py[] = "src\\ulid_transform\\_ulid_impl.pyx";
2195
2217
  /* #### Code section: decls ### */
@@ -2197,6 +2219,8 @@ static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl__ulid_now(CYTHON_UNUSED
2197
2219
  static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl_2_ulid_at_time(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v__time); /* proto */
2198
2220
  static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl_4_ulid_to_bytes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ulid_str); /* proto */
2199
2221
  static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl_6_bytes_to_ulid(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ulid_bytes); /* proto */
2222
+ static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl_8_ulid_to_bytes_or_none(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ulid_str); /* proto */
2223
+ static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl_10_bytes_to_ulid_or_none(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ulid_bytes); /* proto */
2200
2224
  /* #### Code section: late_includes ### */
2201
2225
  /* #### Code section: module_state ### */
2202
2226
  typedef struct {
@@ -2233,13 +2257,17 @@ typedef struct {
2233
2257
  #if CYTHON_USE_MODULE_STATE
2234
2258
  #endif
2235
2259
  PyObject *__pyx_kp_u_;
2236
- PyObject *__pyx_kp_u_ULID_bytes_be_16_bytes;
2260
+ PyObject *__pyx_n_s_Optional;
2261
+ PyObject *__pyx_kp_s_Optional_bytes;
2262
+ PyObject *__pyx_kp_s_Optional_str;
2263
+ PyObject *__pyx_kp_u_ULID_bytes_must_be_16_bytes;
2237
2264
  PyObject *__pyx_kp_u_ULID_must_be_a_26_character_stri;
2238
2265
  PyObject *__pyx_n_s_ValueError;
2239
- PyObject *__pyx_n_s__9;
2266
+ PyObject *__pyx_n_s__11;
2240
2267
  PyObject *__pyx_n_s_asyncio_coroutines;
2241
2268
  PyObject *__pyx_n_s_bytes;
2242
2269
  PyObject *__pyx_n_s_bytes_to_ulid;
2270
+ PyObject *__pyx_n_s_bytes_to_ulid_or_none;
2243
2271
  PyObject *__pyx_n_s_cline_in_traceback;
2244
2272
  PyObject *__pyx_n_s_float;
2245
2273
  PyObject *__pyx_n_s_import;
@@ -2252,11 +2280,13 @@ typedef struct {
2252
2280
  PyObject *__pyx_n_s_test;
2253
2281
  PyObject *__pyx_n_s_time;
2254
2282
  PyObject *__pyx_n_s_time_2;
2283
+ PyObject *__pyx_n_s_typing;
2255
2284
  PyObject *__pyx_n_s_ulid_at_time;
2256
2285
  PyObject *__pyx_n_s_ulid_bytes;
2257
2286
  PyObject *__pyx_n_s_ulid_now;
2258
2287
  PyObject *__pyx_n_s_ulid_str;
2259
2288
  PyObject *__pyx_n_s_ulid_to_bytes;
2289
+ PyObject *__pyx_n_s_ulid_to_bytes_or_none;
2260
2290
  PyObject *__pyx_n_s_ulid_transform__ulid_impl;
2261
2291
  PyObject *__pyx_tuple__3;
2262
2292
  PyObject *__pyx_tuple__5;
@@ -2265,6 +2295,8 @@ typedef struct {
2265
2295
  PyObject *__pyx_codeobj__4;
2266
2296
  PyObject *__pyx_codeobj__6;
2267
2297
  PyObject *__pyx_codeobj__8;
2298
+ PyObject *__pyx_codeobj__9;
2299
+ PyObject *__pyx_codeobj__10;
2268
2300
  } __pyx_mstate;
2269
2301
 
2270
2302
  #if CYTHON_USE_MODULE_STATE
@@ -2308,13 +2340,17 @@ static int __pyx_m_clear(PyObject *m) {
2308
2340
  Py_CLEAR(clear_module_state->__pyx_FusedFunctionType);
2309
2341
  #endif
2310
2342
  Py_CLEAR(clear_module_state->__pyx_kp_u_);
2311
- Py_CLEAR(clear_module_state->__pyx_kp_u_ULID_bytes_be_16_bytes);
2343
+ Py_CLEAR(clear_module_state->__pyx_n_s_Optional);
2344
+ Py_CLEAR(clear_module_state->__pyx_kp_s_Optional_bytes);
2345
+ Py_CLEAR(clear_module_state->__pyx_kp_s_Optional_str);
2346
+ Py_CLEAR(clear_module_state->__pyx_kp_u_ULID_bytes_must_be_16_bytes);
2312
2347
  Py_CLEAR(clear_module_state->__pyx_kp_u_ULID_must_be_a_26_character_stri);
2313
2348
  Py_CLEAR(clear_module_state->__pyx_n_s_ValueError);
2314
- Py_CLEAR(clear_module_state->__pyx_n_s__9);
2349
+ Py_CLEAR(clear_module_state->__pyx_n_s__11);
2315
2350
  Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines);
2316
2351
  Py_CLEAR(clear_module_state->__pyx_n_s_bytes);
2317
2352
  Py_CLEAR(clear_module_state->__pyx_n_s_bytes_to_ulid);
2353
+ Py_CLEAR(clear_module_state->__pyx_n_s_bytes_to_ulid_or_none);
2318
2354
  Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback);
2319
2355
  Py_CLEAR(clear_module_state->__pyx_n_s_float);
2320
2356
  Py_CLEAR(clear_module_state->__pyx_n_s_import);
@@ -2327,11 +2363,13 @@ static int __pyx_m_clear(PyObject *m) {
2327
2363
  Py_CLEAR(clear_module_state->__pyx_n_s_test);
2328
2364
  Py_CLEAR(clear_module_state->__pyx_n_s_time);
2329
2365
  Py_CLEAR(clear_module_state->__pyx_n_s_time_2);
2366
+ Py_CLEAR(clear_module_state->__pyx_n_s_typing);
2330
2367
  Py_CLEAR(clear_module_state->__pyx_n_s_ulid_at_time);
2331
2368
  Py_CLEAR(clear_module_state->__pyx_n_s_ulid_bytes);
2332
2369
  Py_CLEAR(clear_module_state->__pyx_n_s_ulid_now);
2333
2370
  Py_CLEAR(clear_module_state->__pyx_n_s_ulid_str);
2334
2371
  Py_CLEAR(clear_module_state->__pyx_n_s_ulid_to_bytes);
2372
+ Py_CLEAR(clear_module_state->__pyx_n_s_ulid_to_bytes_or_none);
2335
2373
  Py_CLEAR(clear_module_state->__pyx_n_s_ulid_transform__ulid_impl);
2336
2374
  Py_CLEAR(clear_module_state->__pyx_tuple__3);
2337
2375
  Py_CLEAR(clear_module_state->__pyx_tuple__5);
@@ -2340,6 +2378,8 @@ static int __pyx_m_clear(PyObject *m) {
2340
2378
  Py_CLEAR(clear_module_state->__pyx_codeobj__4);
2341
2379
  Py_CLEAR(clear_module_state->__pyx_codeobj__6);
2342
2380
  Py_CLEAR(clear_module_state->__pyx_codeobj__8);
2381
+ Py_CLEAR(clear_module_state->__pyx_codeobj__9);
2382
+ Py_CLEAR(clear_module_state->__pyx_codeobj__10);
2343
2383
  return 0;
2344
2384
  }
2345
2385
  #endif
@@ -2361,13 +2401,17 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
2361
2401
  Py_VISIT(traverse_module_state->__pyx_FusedFunctionType);
2362
2402
  #endif
2363
2403
  Py_VISIT(traverse_module_state->__pyx_kp_u_);
2364
- Py_VISIT(traverse_module_state->__pyx_kp_u_ULID_bytes_be_16_bytes);
2404
+ Py_VISIT(traverse_module_state->__pyx_n_s_Optional);
2405
+ Py_VISIT(traverse_module_state->__pyx_kp_s_Optional_bytes);
2406
+ Py_VISIT(traverse_module_state->__pyx_kp_s_Optional_str);
2407
+ Py_VISIT(traverse_module_state->__pyx_kp_u_ULID_bytes_must_be_16_bytes);
2365
2408
  Py_VISIT(traverse_module_state->__pyx_kp_u_ULID_must_be_a_26_character_stri);
2366
2409
  Py_VISIT(traverse_module_state->__pyx_n_s_ValueError);
2367
- Py_VISIT(traverse_module_state->__pyx_n_s__9);
2410
+ Py_VISIT(traverse_module_state->__pyx_n_s__11);
2368
2411
  Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines);
2369
2412
  Py_VISIT(traverse_module_state->__pyx_n_s_bytes);
2370
2413
  Py_VISIT(traverse_module_state->__pyx_n_s_bytes_to_ulid);
2414
+ Py_VISIT(traverse_module_state->__pyx_n_s_bytes_to_ulid_or_none);
2371
2415
  Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback);
2372
2416
  Py_VISIT(traverse_module_state->__pyx_n_s_float);
2373
2417
  Py_VISIT(traverse_module_state->__pyx_n_s_import);
@@ -2380,11 +2424,13 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
2380
2424
  Py_VISIT(traverse_module_state->__pyx_n_s_test);
2381
2425
  Py_VISIT(traverse_module_state->__pyx_n_s_time);
2382
2426
  Py_VISIT(traverse_module_state->__pyx_n_s_time_2);
2427
+ Py_VISIT(traverse_module_state->__pyx_n_s_typing);
2383
2428
  Py_VISIT(traverse_module_state->__pyx_n_s_ulid_at_time);
2384
2429
  Py_VISIT(traverse_module_state->__pyx_n_s_ulid_bytes);
2385
2430
  Py_VISIT(traverse_module_state->__pyx_n_s_ulid_now);
2386
2431
  Py_VISIT(traverse_module_state->__pyx_n_s_ulid_str);
2387
2432
  Py_VISIT(traverse_module_state->__pyx_n_s_ulid_to_bytes);
2433
+ Py_VISIT(traverse_module_state->__pyx_n_s_ulid_to_bytes_or_none);
2388
2434
  Py_VISIT(traverse_module_state->__pyx_n_s_ulid_transform__ulid_impl);
2389
2435
  Py_VISIT(traverse_module_state->__pyx_tuple__3);
2390
2436
  Py_VISIT(traverse_module_state->__pyx_tuple__5);
@@ -2393,6 +2439,8 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
2393
2439
  Py_VISIT(traverse_module_state->__pyx_codeobj__4);
2394
2440
  Py_VISIT(traverse_module_state->__pyx_codeobj__6);
2395
2441
  Py_VISIT(traverse_module_state->__pyx_codeobj__8);
2442
+ Py_VISIT(traverse_module_state->__pyx_codeobj__9);
2443
+ Py_VISIT(traverse_module_state->__pyx_codeobj__10);
2396
2444
  return 0;
2397
2445
  }
2398
2446
  #endif
@@ -2430,13 +2478,17 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
2430
2478
  #if CYTHON_USE_MODULE_STATE
2431
2479
  #endif
2432
2480
  #define __pyx_kp_u_ __pyx_mstate_global->__pyx_kp_u_
2433
- #define __pyx_kp_u_ULID_bytes_be_16_bytes __pyx_mstate_global->__pyx_kp_u_ULID_bytes_be_16_bytes
2481
+ #define __pyx_n_s_Optional __pyx_mstate_global->__pyx_n_s_Optional
2482
+ #define __pyx_kp_s_Optional_bytes __pyx_mstate_global->__pyx_kp_s_Optional_bytes
2483
+ #define __pyx_kp_s_Optional_str __pyx_mstate_global->__pyx_kp_s_Optional_str
2484
+ #define __pyx_kp_u_ULID_bytes_must_be_16_bytes __pyx_mstate_global->__pyx_kp_u_ULID_bytes_must_be_16_bytes
2434
2485
  #define __pyx_kp_u_ULID_must_be_a_26_character_stri __pyx_mstate_global->__pyx_kp_u_ULID_must_be_a_26_character_stri
2435
2486
  #define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError
2436
- #define __pyx_n_s__9 __pyx_mstate_global->__pyx_n_s__9
2487
+ #define __pyx_n_s__11 __pyx_mstate_global->__pyx_n_s__11
2437
2488
  #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines
2438
2489
  #define __pyx_n_s_bytes __pyx_mstate_global->__pyx_n_s_bytes
2439
2490
  #define __pyx_n_s_bytes_to_ulid __pyx_mstate_global->__pyx_n_s_bytes_to_ulid
2491
+ #define __pyx_n_s_bytes_to_ulid_or_none __pyx_mstate_global->__pyx_n_s_bytes_to_ulid_or_none
2440
2492
  #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback
2441
2493
  #define __pyx_n_s_float __pyx_mstate_global->__pyx_n_s_float
2442
2494
  #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import
@@ -2449,11 +2501,13 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
2449
2501
  #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test
2450
2502
  #define __pyx_n_s_time __pyx_mstate_global->__pyx_n_s_time
2451
2503
  #define __pyx_n_s_time_2 __pyx_mstate_global->__pyx_n_s_time_2
2504
+ #define __pyx_n_s_typing __pyx_mstate_global->__pyx_n_s_typing
2452
2505
  #define __pyx_n_s_ulid_at_time __pyx_mstate_global->__pyx_n_s_ulid_at_time
2453
2506
  #define __pyx_n_s_ulid_bytes __pyx_mstate_global->__pyx_n_s_ulid_bytes
2454
2507
  #define __pyx_n_s_ulid_now __pyx_mstate_global->__pyx_n_s_ulid_now
2455
2508
  #define __pyx_n_s_ulid_str __pyx_mstate_global->__pyx_n_s_ulid_str
2456
2509
  #define __pyx_n_s_ulid_to_bytes __pyx_mstate_global->__pyx_n_s_ulid_to_bytes
2510
+ #define __pyx_n_s_ulid_to_bytes_or_none __pyx_mstate_global->__pyx_n_s_ulid_to_bytes_or_none
2457
2511
  #define __pyx_n_s_ulid_transform__ulid_impl __pyx_mstate_global->__pyx_n_s_ulid_transform__ulid_impl
2458
2512
  #define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3
2459
2513
  #define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5
@@ -2462,28 +2516,30 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
2462
2516
  #define __pyx_codeobj__4 __pyx_mstate_global->__pyx_codeobj__4
2463
2517
  #define __pyx_codeobj__6 __pyx_mstate_global->__pyx_codeobj__6
2464
2518
  #define __pyx_codeobj__8 __pyx_mstate_global->__pyx_codeobj__8
2519
+ #define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9
2520
+ #define __pyx_codeobj__10 __pyx_mstate_global->__pyx_codeobj__10
2465
2521
  /* #### Code section: module_code ### */
2466
2522
 
2467
2523
  /* "string.to_py":31
2468
2524
  *
2469
- * @cname("__pyx_convert_PyObject_string_to_py_std__in_string")
2470
- * cdef inline object __pyx_convert_PyObject_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
2525
+ * @cname("__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string")
2526
+ * cdef inline object __pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string(const string& s): # <<<<<<<<<<<<<<
2471
2527
  * return __Pyx_PyObject_FromStringAndSize(s.data(), s.size())
2472
2528
  * cdef extern from *:
2473
2529
  */
2474
2530
 
2475
- static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_string(std::string const &__pyx_v_s) {
2531
+ static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string(std::string const &__pyx_v_s) {
2476
2532
  PyObject *__pyx_r = NULL;
2477
2533
  __Pyx_RefNannyDeclarations
2478
2534
  PyObject *__pyx_t_1 = NULL;
2479
2535
  int __pyx_lineno = 0;
2480
2536
  const char *__pyx_filename = NULL;
2481
2537
  int __pyx_clineno = 0;
2482
- __Pyx_RefNannySetupContext("__pyx_convert_PyObject_string_to_py_std__in_string", 1);
2538
+ __Pyx_RefNannySetupContext("__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string", 1);
2483
2539
 
2484
2540
  /* "string.to_py":32
2485
- * @cname("__pyx_convert_PyObject_string_to_py_std__in_string")
2486
- * cdef inline object __pyx_convert_PyObject_string_to_py_std__in_string(const string& s):
2541
+ * @cname("__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string")
2542
+ * cdef inline object __pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string(const string& s):
2487
2543
  * return __Pyx_PyObject_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
2488
2544
  * cdef extern from *:
2489
2545
  * cdef object __Pyx_PyUnicode_FromStringAndSize(const char*, size_t)
@@ -2497,8 +2553,8 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_strin
2497
2553
 
2498
2554
  /* "string.to_py":31
2499
2555
  *
2500
- * @cname("__pyx_convert_PyObject_string_to_py_std__in_string")
2501
- * cdef inline object __pyx_convert_PyObject_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
2556
+ * @cname("__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string")
2557
+ * cdef inline object __pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string(const string& s): # <<<<<<<<<<<<<<
2502
2558
  * return __Pyx_PyObject_FromStringAndSize(s.data(), s.size())
2503
2559
  * cdef extern from *:
2504
2560
  */
@@ -2506,7 +2562,7 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_strin
2506
2562
  /* function exit code */
2507
2563
  __pyx_L1_error:;
2508
2564
  __Pyx_XDECREF(__pyx_t_1);
2509
- __Pyx_AddTraceback("string.to_py.__pyx_convert_PyObject_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
2565
+ __Pyx_AddTraceback("string.to_py.__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
2510
2566
  __pyx_r = 0;
2511
2567
  __pyx_L0:;
2512
2568
  __Pyx_XGIVEREF(__pyx_r);
@@ -2516,24 +2572,24 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_strin
2516
2572
 
2517
2573
  /* "string.to_py":37
2518
2574
  *
2519
- * @cname("__pyx_convert_PyUnicode_string_to_py_std__in_string")
2520
- * cdef inline object __pyx_convert_PyUnicode_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
2575
+ * @cname("__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string")
2576
+ * cdef inline object __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(const string& s): # <<<<<<<<<<<<<<
2521
2577
  * return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size())
2522
2578
  * cdef extern from *:
2523
2579
  */
2524
2580
 
2525
- static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_string(std::string const &__pyx_v_s) {
2581
+ static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(std::string const &__pyx_v_s) {
2526
2582
  PyObject *__pyx_r = NULL;
2527
2583
  __Pyx_RefNannyDeclarations
2528
2584
  PyObject *__pyx_t_1 = NULL;
2529
2585
  int __pyx_lineno = 0;
2530
2586
  const char *__pyx_filename = NULL;
2531
2587
  int __pyx_clineno = 0;
2532
- __Pyx_RefNannySetupContext("__pyx_convert_PyUnicode_string_to_py_std__in_string", 1);
2588
+ __Pyx_RefNannySetupContext("__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string", 1);
2533
2589
 
2534
2590
  /* "string.to_py":38
2535
- * @cname("__pyx_convert_PyUnicode_string_to_py_std__in_string")
2536
- * cdef inline object __pyx_convert_PyUnicode_string_to_py_std__in_string(const string& s):
2591
+ * @cname("__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string")
2592
+ * cdef inline object __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(const string& s):
2537
2593
  * return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
2538
2594
  * cdef extern from *:
2539
2595
  * cdef object __Pyx_PyStr_FromStringAndSize(const char*, size_t)
@@ -2547,8 +2603,8 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_stri
2547
2603
 
2548
2604
  /* "string.to_py":37
2549
2605
  *
2550
- * @cname("__pyx_convert_PyUnicode_string_to_py_std__in_string")
2551
- * cdef inline object __pyx_convert_PyUnicode_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
2606
+ * @cname("__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string")
2607
+ * cdef inline object __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(const string& s): # <<<<<<<<<<<<<<
2552
2608
  * return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size())
2553
2609
  * cdef extern from *:
2554
2610
  */
@@ -2556,7 +2612,7 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_stri
2556
2612
  /* function exit code */
2557
2613
  __pyx_L1_error:;
2558
2614
  __Pyx_XDECREF(__pyx_t_1);
2559
- __Pyx_AddTraceback("string.to_py.__pyx_convert_PyUnicode_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
2615
+ __Pyx_AddTraceback("string.to_py.__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
2560
2616
  __pyx_r = 0;
2561
2617
  __pyx_L0:;
2562
2618
  __Pyx_XGIVEREF(__pyx_r);
@@ -2566,24 +2622,24 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_stri
2566
2622
 
2567
2623
  /* "string.to_py":43
2568
2624
  *
2569
- * @cname("__pyx_convert_PyStr_string_to_py_std__in_string")
2570
- * cdef inline object __pyx_convert_PyStr_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
2625
+ * @cname("__pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string")
2626
+ * cdef inline object __pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string(const string& s): # <<<<<<<<<<<<<<
2571
2627
  * return __Pyx_PyStr_FromStringAndSize(s.data(), s.size())
2572
2628
  * cdef extern from *:
2573
2629
  */
2574
2630
 
2575
- static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(std::string const &__pyx_v_s) {
2631
+ static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string(std::string const &__pyx_v_s) {
2576
2632
  PyObject *__pyx_r = NULL;
2577
2633
  __Pyx_RefNannyDeclarations
2578
2634
  PyObject *__pyx_t_1 = NULL;
2579
2635
  int __pyx_lineno = 0;
2580
2636
  const char *__pyx_filename = NULL;
2581
2637
  int __pyx_clineno = 0;
2582
- __Pyx_RefNannySetupContext("__pyx_convert_PyStr_string_to_py_std__in_string", 1);
2638
+ __Pyx_RefNannySetupContext("__pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string", 1);
2583
2639
 
2584
2640
  /* "string.to_py":44
2585
- * @cname("__pyx_convert_PyStr_string_to_py_std__in_string")
2586
- * cdef inline object __pyx_convert_PyStr_string_to_py_std__in_string(const string& s):
2641
+ * @cname("__pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string")
2642
+ * cdef inline object __pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string(const string& s):
2587
2643
  * return __Pyx_PyStr_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
2588
2644
  * cdef extern from *:
2589
2645
  * cdef object __Pyx_PyBytes_FromStringAndSize(const char*, size_t)
@@ -2597,8 +2653,8 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(s
2597
2653
 
2598
2654
  /* "string.to_py":43
2599
2655
  *
2600
- * @cname("__pyx_convert_PyStr_string_to_py_std__in_string")
2601
- * cdef inline object __pyx_convert_PyStr_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
2656
+ * @cname("__pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string")
2657
+ * cdef inline object __pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string(const string& s): # <<<<<<<<<<<<<<
2602
2658
  * return __Pyx_PyStr_FromStringAndSize(s.data(), s.size())
2603
2659
  * cdef extern from *:
2604
2660
  */
@@ -2606,7 +2662,7 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(s
2606
2662
  /* function exit code */
2607
2663
  __pyx_L1_error:;
2608
2664
  __Pyx_XDECREF(__pyx_t_1);
2609
- __Pyx_AddTraceback("string.to_py.__pyx_convert_PyStr_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
2665
+ __Pyx_AddTraceback("string.to_py.__pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
2610
2666
  __pyx_r = 0;
2611
2667
  __pyx_L0:;
2612
2668
  __Pyx_XGIVEREF(__pyx_r);
@@ -2616,24 +2672,24 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(s
2616
2672
 
2617
2673
  /* "string.to_py":49
2618
2674
  *
2619
- * @cname("__pyx_convert_PyBytes_string_to_py_std__in_string")
2620
- * cdef inline object __pyx_convert_PyBytes_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
2675
+ * @cname("__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string")
2676
+ * cdef inline object __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(const string& s): # <<<<<<<<<<<<<<
2621
2677
  * return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size())
2622
2678
  * cdef extern from *:
2623
2679
  */
2624
2680
 
2625
- static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string(std::string const &__pyx_v_s) {
2681
+ static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(std::string const &__pyx_v_s) {
2626
2682
  PyObject *__pyx_r = NULL;
2627
2683
  __Pyx_RefNannyDeclarations
2628
2684
  PyObject *__pyx_t_1 = NULL;
2629
2685
  int __pyx_lineno = 0;
2630
2686
  const char *__pyx_filename = NULL;
2631
2687
  int __pyx_clineno = 0;
2632
- __Pyx_RefNannySetupContext("__pyx_convert_PyBytes_string_to_py_std__in_string", 1);
2688
+ __Pyx_RefNannySetupContext("__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string", 1);
2633
2689
 
2634
2690
  /* "string.to_py":50
2635
- * @cname("__pyx_convert_PyBytes_string_to_py_std__in_string")
2636
- * cdef inline object __pyx_convert_PyBytes_string_to_py_std__in_string(const string& s):
2691
+ * @cname("__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string")
2692
+ * cdef inline object __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(const string& s):
2637
2693
  * return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
2638
2694
  * cdef extern from *:
2639
2695
  * cdef object __Pyx_PyByteArray_FromStringAndSize(const char*, size_t)
@@ -2647,8 +2703,8 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string
2647
2703
 
2648
2704
  /* "string.to_py":49
2649
2705
  *
2650
- * @cname("__pyx_convert_PyBytes_string_to_py_std__in_string")
2651
- * cdef inline object __pyx_convert_PyBytes_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
2706
+ * @cname("__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string")
2707
+ * cdef inline object __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(const string& s): # <<<<<<<<<<<<<<
2652
2708
  * return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size())
2653
2709
  * cdef extern from *:
2654
2710
  */
@@ -2656,7 +2712,7 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string
2656
2712
  /* function exit code */
2657
2713
  __pyx_L1_error:;
2658
2714
  __Pyx_XDECREF(__pyx_t_1);
2659
- __Pyx_AddTraceback("string.to_py.__pyx_convert_PyBytes_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
2715
+ __Pyx_AddTraceback("string.to_py.__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
2660
2716
  __pyx_r = 0;
2661
2717
  __pyx_L0:;
2662
2718
  __Pyx_XGIVEREF(__pyx_r);
@@ -2666,24 +2722,24 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string
2666
2722
 
2667
2723
  /* "string.to_py":55
2668
2724
  *
2669
- * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string")
2670
- * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
2725
+ * @cname("__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string")
2726
+ * cdef inline object __pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string(const string& s): # <<<<<<<<<<<<<<
2671
2727
  * return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size())
2672
2728
  *
2673
2729
  */
2674
2730
 
2675
- static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_string(std::string const &__pyx_v_s) {
2731
+ static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string(std::string const &__pyx_v_s) {
2676
2732
  PyObject *__pyx_r = NULL;
2677
2733
  __Pyx_RefNannyDeclarations
2678
2734
  PyObject *__pyx_t_1 = NULL;
2679
2735
  int __pyx_lineno = 0;
2680
2736
  const char *__pyx_filename = NULL;
2681
2737
  int __pyx_clineno = 0;
2682
- __Pyx_RefNannySetupContext("__pyx_convert_PyByteArray_string_to_py_std__in_string", 1);
2738
+ __Pyx_RefNannySetupContext("__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string", 1);
2683
2739
 
2684
2740
  /* "string.to_py":56
2685
- * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string")
2686
- * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s):
2741
+ * @cname("__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string")
2742
+ * cdef inline object __pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string(const string& s):
2687
2743
  * return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
2688
2744
  *
2689
2745
  */
@@ -2696,8 +2752,8 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_st
2696
2752
 
2697
2753
  /* "string.to_py":55
2698
2754
  *
2699
- * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string")
2700
- * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
2755
+ * @cname("__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string")
2756
+ * cdef inline object __pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string(const string& s): # <<<<<<<<<<<<<<
2701
2757
  * return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size())
2702
2758
  *
2703
2759
  */
@@ -2705,7 +2761,7 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_st
2705
2761
  /* function exit code */
2706
2762
  __pyx_L1_error:;
2707
2763
  __Pyx_XDECREF(__pyx_t_1);
2708
- __Pyx_AddTraceback("string.to_py.__pyx_convert_PyByteArray_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
2764
+ __Pyx_AddTraceback("string.to_py.__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
2709
2765
  __pyx_r = 0;
2710
2766
  __pyx_L0:;
2711
2767
  __Pyx_XGIVEREF(__pyx_r);
@@ -2715,13 +2771,13 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_st
2715
2771
 
2716
2772
  /* "string.from_py":13
2717
2773
  *
2718
- * @cname("__pyx_convert_string_from_py_std__in_string")
2719
- * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: # <<<<<<<<<<<<<<
2774
+ * @cname("__pyx_convert_string_from_py_6libcpp_6string_std__in_string")
2775
+ * cdef string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(object o) except *: # <<<<<<<<<<<<<<
2720
2776
  * cdef Py_ssize_t length = 0
2721
2777
  * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
2722
2778
  */
2723
2779
 
2724
- static std::string __pyx_convert_string_from_py_std__in_string(PyObject *__pyx_v_o) {
2780
+ static std::string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(PyObject *__pyx_v_o) {
2725
2781
  Py_ssize_t __pyx_v_length;
2726
2782
  char const *__pyx_v_data;
2727
2783
  std::string __pyx_r;
@@ -2732,8 +2788,8 @@ static std::string __pyx_convert_string_from_py_std__in_string(PyObject *__pyx_v
2732
2788
  int __pyx_clineno = 0;
2733
2789
 
2734
2790
  /* "string.from_py":14
2735
- * @cname("__pyx_convert_string_from_py_std__in_string")
2736
- * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *:
2791
+ * @cname("__pyx_convert_string_from_py_6libcpp_6string_std__in_string")
2792
+ * cdef string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(object o) except *:
2737
2793
  * cdef Py_ssize_t length = 0 # <<<<<<<<<<<<<<
2738
2794
  * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
2739
2795
  * return string(data, length)
@@ -2741,7 +2797,7 @@ static std::string __pyx_convert_string_from_py_std__in_string(PyObject *__pyx_v
2741
2797
  __pyx_v_length = 0;
2742
2798
 
2743
2799
  /* "string.from_py":15
2744
- * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *:
2800
+ * cdef string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(object o) except *:
2745
2801
  * cdef Py_ssize_t length = 0
2746
2802
  * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) # <<<<<<<<<<<<<<
2747
2803
  * return string(data, length)
@@ -2768,21 +2824,21 @@ static std::string __pyx_convert_string_from_py_std__in_string(PyObject *__pyx_v
2768
2824
 
2769
2825
  /* "string.from_py":13
2770
2826
  *
2771
- * @cname("__pyx_convert_string_from_py_std__in_string")
2772
- * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: # <<<<<<<<<<<<<<
2827
+ * @cname("__pyx_convert_string_from_py_6libcpp_6string_std__in_string")
2828
+ * cdef string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(object o) except *: # <<<<<<<<<<<<<<
2773
2829
  * cdef Py_ssize_t length = 0
2774
2830
  * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
2775
2831
  */
2776
2832
 
2777
2833
  /* function exit code */
2778
2834
  __pyx_L1_error:;
2779
- __Pyx_AddTraceback("string.from_py.__pyx_convert_string_from_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
2835
+ __Pyx_AddTraceback("string.from_py.__pyx_convert_string_from_py_6libcpp_6string_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
2780
2836
  __Pyx_pretend_to_initialize(&__pyx_r);
2781
2837
  __pyx_L0:;
2782
2838
  return __pyx_r;
2783
2839
  }
2784
2840
 
2785
- /* "ulid_transform/_ulid_impl.pyx":16
2841
+ /* "ulid_transform/_ulid_impl.pyx":17
2786
2842
  *
2787
2843
  *
2788
2844
  * def _ulid_now() -> str: # <<<<<<<<<<<<<<
@@ -2815,7 +2871,7 @@ static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl__ulid_now(CYTHON_UNUSED
2815
2871
  int __pyx_clineno = 0;
2816
2872
  __Pyx_RefNannySetupContext("_ulid_now", 1);
2817
2873
 
2818
- /* "ulid_transform/_ulid_impl.pyx":17
2874
+ /* "ulid_transform/_ulid_impl.pyx":18
2819
2875
  *
2820
2876
  * def _ulid_now() -> str:
2821
2877
  * return _cpp_ulid().decode("ascii") # <<<<<<<<<<<<<<
@@ -2823,13 +2879,13 @@ static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl__ulid_now(CYTHON_UNUSED
2823
2879
  * def _ulid_at_time(_time: float) -> str:
2824
2880
  */
2825
2881
  __Pyx_XDECREF(__pyx_r);
2826
- __pyx_t_1 = __Pyx_decode_cpp_string(_cpp_ulid(), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error)
2882
+ __pyx_t_1 = __Pyx_decode_cpp_string(_cpp_ulid(), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error)
2827
2883
  __Pyx_GOTREF(__pyx_t_1);
2828
2884
  __pyx_r = ((PyObject*)__pyx_t_1);
2829
2885
  __pyx_t_1 = 0;
2830
2886
  goto __pyx_L0;
2831
2887
 
2832
- /* "ulid_transform/_ulid_impl.pyx":16
2888
+ /* "ulid_transform/_ulid_impl.pyx":17
2833
2889
  *
2834
2890
  *
2835
2891
  * def _ulid_now() -> str: # <<<<<<<<<<<<<<
@@ -2848,7 +2904,7 @@ static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl__ulid_now(CYTHON_UNUSED
2848
2904
  return __pyx_r;
2849
2905
  }
2850
2906
 
2851
- /* "ulid_transform/_ulid_impl.pyx":19
2907
+ /* "ulid_transform/_ulid_impl.pyx":20
2852
2908
  * return _cpp_ulid().decode("ascii")
2853
2909
  *
2854
2910
  * def _ulid_at_time(_time: float) -> str: # <<<<<<<<<<<<<<
@@ -2909,23 +2965,23 @@ PyObject *__pyx_args, PyObject *__pyx_kwds
2909
2965
  (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
2910
2966
  kw_args--;
2911
2967
  }
2912
- else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 19, __pyx_L3_error)
2968
+ else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 20, __pyx_L3_error)
2913
2969
  else goto __pyx_L5_argtuple_error;
2914
2970
  }
2915
2971
  if (unlikely(kw_args > 0)) {
2916
2972
  const Py_ssize_t kwd_pos_args = __pyx_nargs;
2917
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_ulid_at_time") < 0)) __PYX_ERR(0, 19, __pyx_L3_error)
2973
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_ulid_at_time") < 0)) __PYX_ERR(0, 20, __pyx_L3_error)
2918
2974
  }
2919
2975
  } else if (unlikely(__pyx_nargs != 1)) {
2920
2976
  goto __pyx_L5_argtuple_error;
2921
2977
  } else {
2922
2978
  values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
2923
2979
  }
2924
- __pyx_v__time = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v__time == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 19, __pyx_L3_error)
2980
+ __pyx_v__time = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v__time == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 20, __pyx_L3_error)
2925
2981
  }
2926
2982
  goto __pyx_L6_skip;
2927
2983
  __pyx_L5_argtuple_error:;
2928
- __Pyx_RaiseArgtupleInvalid("_ulid_at_time", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 19, __pyx_L3_error)
2984
+ __Pyx_RaiseArgtupleInvalid("_ulid_at_time", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 20, __pyx_L3_error)
2929
2985
  __pyx_L6_skip:;
2930
2986
  goto __pyx_L4_argument_unpacking_done;
2931
2987
  __pyx_L3_error:;
@@ -2961,7 +3017,7 @@ static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl_2_ulid_at_time(CYTHON_UN
2961
3017
  int __pyx_clineno = 0;
2962
3018
  __Pyx_RefNannySetupContext("_ulid_at_time", 1);
2963
3019
 
2964
- /* "ulid_transform/_ulid_impl.pyx":20
3020
+ /* "ulid_transform/_ulid_impl.pyx":21
2965
3021
  *
2966
3022
  * def _ulid_at_time(_time: float) -> str:
2967
3023
  * return _cpp_ulid_at_time(_time).decode("ascii") # <<<<<<<<<<<<<<
@@ -2969,13 +3025,13 @@ static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl_2_ulid_at_time(CYTHON_UN
2969
3025
  * def _ulid_to_bytes(ulid_str: str) -> bytes:
2970
3026
  */
2971
3027
  __Pyx_XDECREF(__pyx_r);
2972
- __pyx_t_1 = __Pyx_decode_cpp_string(_cpp_ulid_at_time(__pyx_v__time), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
3028
+ __pyx_t_1 = __Pyx_decode_cpp_string(_cpp_ulid_at_time(__pyx_v__time), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
2973
3029
  __Pyx_GOTREF(__pyx_t_1);
2974
3030
  __pyx_r = ((PyObject*)__pyx_t_1);
2975
3031
  __pyx_t_1 = 0;
2976
3032
  goto __pyx_L0;
2977
3033
 
2978
- /* "ulid_transform/_ulid_impl.pyx":19
3034
+ /* "ulid_transform/_ulid_impl.pyx":20
2979
3035
  * return _cpp_ulid().decode("ascii")
2980
3036
  *
2981
3037
  * def _ulid_at_time(_time: float) -> str: # <<<<<<<<<<<<<<
@@ -2994,7 +3050,7 @@ static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl_2_ulid_at_time(CYTHON_UN
2994
3050
  return __pyx_r;
2995
3051
  }
2996
3052
 
2997
- /* "ulid_transform/_ulid_impl.pyx":22
3053
+ /* "ulid_transform/_ulid_impl.pyx":23
2998
3054
  * return _cpp_ulid_at_time(_time).decode("ascii")
2999
3055
  *
3000
3056
  * def _ulid_to_bytes(ulid_str: str) -> bytes: # <<<<<<<<<<<<<<
@@ -3055,12 +3111,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds
3055
3111
  (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
3056
3112
  kw_args--;
3057
3113
  }
3058
- else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 22, __pyx_L3_error)
3114
+ else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 23, __pyx_L3_error)
3059
3115
  else goto __pyx_L5_argtuple_error;
3060
3116
  }
3061
3117
  if (unlikely(kw_args > 0)) {
3062
3118
  const Py_ssize_t kwd_pos_args = __pyx_nargs;
3063
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_ulid_to_bytes") < 0)) __PYX_ERR(0, 22, __pyx_L3_error)
3119
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_ulid_to_bytes") < 0)) __PYX_ERR(0, 23, __pyx_L3_error)
3064
3120
  }
3065
3121
  } else if (unlikely(__pyx_nargs != 1)) {
3066
3122
  goto __pyx_L5_argtuple_error;
@@ -3071,7 +3127,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds
3071
3127
  }
3072
3128
  goto __pyx_L6_skip;
3073
3129
  __pyx_L5_argtuple_error:;
3074
- __Pyx_RaiseArgtupleInvalid("_ulid_to_bytes", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 22, __pyx_L3_error)
3130
+ __Pyx_RaiseArgtupleInvalid("_ulid_to_bytes", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 23, __pyx_L3_error)
3075
3131
  __pyx_L6_skip:;
3076
3132
  goto __pyx_L4_argument_unpacking_done;
3077
3133
  __pyx_L3_error:;
@@ -3085,7 +3141,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds
3085
3141
  __Pyx_RefNannyFinishContext();
3086
3142
  return NULL;
3087
3143
  __pyx_L4_argument_unpacking_done:;
3088
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ulid_str), (&PyUnicode_Type), 0, "ulid_str", 1))) __PYX_ERR(0, 22, __pyx_L1_error)
3144
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ulid_str), (&PyUnicode_Type), 0, "ulid_str", 1))) __PYX_ERR(0, 23, __pyx_L1_error)
3089
3145
  __pyx_r = __pyx_pf_14ulid_transform_10_ulid_impl_4_ulid_to_bytes(__pyx_self, __pyx_v_ulid_str);
3090
3146
 
3091
3147
  /* function exit code */
@@ -3116,34 +3172,34 @@ static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl_4_ulid_to_bytes(CYTHON_U
3116
3172
  int __pyx_clineno = 0;
3117
3173
  __Pyx_RefNannySetupContext("_ulid_to_bytes", 1);
3118
3174
 
3119
- /* "ulid_transform/_ulid_impl.pyx":23
3175
+ /* "ulid_transform/_ulid_impl.pyx":24
3120
3176
  *
3121
3177
  * def _ulid_to_bytes(ulid_str: str) -> bytes:
3122
3178
  * if len(ulid_str) != 26: # <<<<<<<<<<<<<<
3123
3179
  * raise ValueError(f"ULID must be a 26 character string: {ulid_str}")
3124
3180
  * return _cpp_ulid_to_bytes(ulid_str.encode("ascii"))
3125
3181
  */
3126
- __pyx_t_1 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_ulid_str); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 23, __pyx_L1_error)
3182
+ __pyx_t_1 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_ulid_str); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 24, __pyx_L1_error)
3127
3183
  __pyx_t_2 = (__pyx_t_1 != 26);
3128
3184
  if (unlikely(__pyx_t_2)) {
3129
3185
 
3130
- /* "ulid_transform/_ulid_impl.pyx":24
3186
+ /* "ulid_transform/_ulid_impl.pyx":25
3131
3187
  * def _ulid_to_bytes(ulid_str: str) -> bytes:
3132
3188
  * if len(ulid_str) != 26:
3133
3189
  * raise ValueError(f"ULID must be a 26 character string: {ulid_str}") # <<<<<<<<<<<<<<
3134
3190
  * return _cpp_ulid_to_bytes(ulid_str.encode("ascii"))
3135
3191
  *
3136
3192
  */
3137
- __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_ULID_must_be_a_26_character_stri, __pyx_v_ulid_str); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error)
3193
+ __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_ULID_must_be_a_26_character_stri, __pyx_v_ulid_str); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error)
3138
3194
  __Pyx_GOTREF(__pyx_t_3);
3139
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 24, __pyx_L1_error)
3195
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 25, __pyx_L1_error)
3140
3196
  __Pyx_GOTREF(__pyx_t_4);
3141
3197
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3142
3198
  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
3143
3199
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3144
- __PYX_ERR(0, 24, __pyx_L1_error)
3200
+ __PYX_ERR(0, 25, __pyx_L1_error)
3145
3201
 
3146
- /* "ulid_transform/_ulid_impl.pyx":23
3202
+ /* "ulid_transform/_ulid_impl.pyx":24
3147
3203
  *
3148
3204
  * def _ulid_to_bytes(ulid_str: str) -> bytes:
3149
3205
  * if len(ulid_str) != 26: # <<<<<<<<<<<<<<
@@ -3152,7 +3208,7 @@ static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl_4_ulid_to_bytes(CYTHON_U
3152
3208
  */
3153
3209
  }
3154
3210
 
3155
- /* "ulid_transform/_ulid_impl.pyx":25
3211
+ /* "ulid_transform/_ulid_impl.pyx":26
3156
3212
  * if len(ulid_str) != 26:
3157
3213
  * raise ValueError(f"ULID must be a 26 character string: {ulid_str}")
3158
3214
  * return _cpp_ulid_to_bytes(ulid_str.encode("ascii")) # <<<<<<<<<<<<<<
@@ -3160,17 +3216,17 @@ static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl_4_ulid_to_bytes(CYTHON_U
3160
3216
  * def _bytes_to_ulid(ulid_bytes: bytes) -> str:
3161
3217
  */
3162
3218
  __Pyx_XDECREF(__pyx_r);
3163
- __pyx_t_4 = PyUnicode_AsASCIIString(__pyx_v_ulid_str); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 25, __pyx_L1_error)
3219
+ __pyx_t_4 = PyUnicode_AsASCIIString(__pyx_v_ulid_str); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 26, __pyx_L1_error)
3164
3220
  __Pyx_GOTREF(__pyx_t_4);
3165
- __pyx_t_5 = __Pyx_PyBytes_AsString(__pyx_t_4); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 25, __pyx_L1_error)
3166
- __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(_cpp_ulid_to_bytes(__pyx_t_5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error)
3221
+ __pyx_t_5 = __Pyx_PyBytes_AsString(__pyx_t_4); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 26, __pyx_L1_error)
3222
+ __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(_cpp_ulid_to_bytes(__pyx_t_5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 26, __pyx_L1_error)
3167
3223
  __Pyx_GOTREF(__pyx_t_3);
3168
3224
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3169
3225
  __pyx_r = ((PyObject*)__pyx_t_3);
3170
3226
  __pyx_t_3 = 0;
3171
3227
  goto __pyx_L0;
3172
3228
 
3173
- /* "ulid_transform/_ulid_impl.pyx":22
3229
+ /* "ulid_transform/_ulid_impl.pyx":23
3174
3230
  * return _cpp_ulid_at_time(_time).decode("ascii")
3175
3231
  *
3176
3232
  * def _ulid_to_bytes(ulid_str: str) -> bytes: # <<<<<<<<<<<<<<
@@ -3190,12 +3246,12 @@ static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl_4_ulid_to_bytes(CYTHON_U
3190
3246
  return __pyx_r;
3191
3247
  }
3192
3248
 
3193
- /* "ulid_transform/_ulid_impl.pyx":27
3249
+ /* "ulid_transform/_ulid_impl.pyx":28
3194
3250
  * return _cpp_ulid_to_bytes(ulid_str.encode("ascii"))
3195
3251
  *
3196
3252
  * def _bytes_to_ulid(ulid_bytes: bytes) -> str: # <<<<<<<<<<<<<<
3197
3253
  * if len(ulid_bytes) != 16:
3198
- * raise ValueError(f"ULID bytes be 16 bytes: {ulid_bytes}")
3254
+ * raise ValueError(f"ULID bytes must be 16 bytes: {ulid_bytes!r}")
3199
3255
  */
3200
3256
 
3201
3257
  /* Python wrapper */
@@ -3251,12 +3307,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds
3251
3307
  (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
3252
3308
  kw_args--;
3253
3309
  }
3254
- else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 27, __pyx_L3_error)
3310
+ else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 28, __pyx_L3_error)
3255
3311
  else goto __pyx_L5_argtuple_error;
3256
3312
  }
3257
3313
  if (unlikely(kw_args > 0)) {
3258
3314
  const Py_ssize_t kwd_pos_args = __pyx_nargs;
3259
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_bytes_to_ulid") < 0)) __PYX_ERR(0, 27, __pyx_L3_error)
3315
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_bytes_to_ulid") < 0)) __PYX_ERR(0, 28, __pyx_L3_error)
3260
3316
  }
3261
3317
  } else if (unlikely(__pyx_nargs != 1)) {
3262
3318
  goto __pyx_L5_argtuple_error;
@@ -3267,7 +3323,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds
3267
3323
  }
3268
3324
  goto __pyx_L6_skip;
3269
3325
  __pyx_L5_argtuple_error:;
3270
- __Pyx_RaiseArgtupleInvalid("_bytes_to_ulid", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 27, __pyx_L3_error)
3326
+ __Pyx_RaiseArgtupleInvalid("_bytes_to_ulid", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 28, __pyx_L3_error)
3271
3327
  __pyx_L6_skip:;
3272
3328
  goto __pyx_L4_argument_unpacking_done;
3273
3329
  __pyx_L3_error:;
@@ -3281,7 +3337,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds
3281
3337
  __Pyx_RefNannyFinishContext();
3282
3338
  return NULL;
3283
3339
  __pyx_L4_argument_unpacking_done:;
3284
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ulid_bytes), (&PyBytes_Type), 0, "ulid_bytes", 1))) __PYX_ERR(0, 27, __pyx_L1_error)
3340
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ulid_bytes), (&PyBytes_Type), 0, "ulid_bytes", 1))) __PYX_ERR(0, 28, __pyx_L1_error)
3285
3341
  __pyx_r = __pyx_pf_14ulid_transform_10_ulid_impl_6_bytes_to_ulid(__pyx_self, __pyx_v_ulid_bytes);
3286
3342
 
3287
3343
  /* function exit code */
@@ -3312,63 +3368,66 @@ static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl_6_bytes_to_ulid(CYTHON_U
3312
3368
  int __pyx_clineno = 0;
3313
3369
  __Pyx_RefNannySetupContext("_bytes_to_ulid", 1);
3314
3370
 
3315
- /* "ulid_transform/_ulid_impl.pyx":28
3371
+ /* "ulid_transform/_ulid_impl.pyx":29
3316
3372
  *
3317
3373
  * def _bytes_to_ulid(ulid_bytes: bytes) -> str:
3318
3374
  * if len(ulid_bytes) != 16: # <<<<<<<<<<<<<<
3319
- * raise ValueError(f"ULID bytes be 16 bytes: {ulid_bytes}")
3375
+ * raise ValueError(f"ULID bytes must be 16 bytes: {ulid_bytes!r}")
3320
3376
  * return _cpp_bytes_to_ulid(ulid_bytes).decode("ascii")
3321
3377
  */
3322
- __pyx_t_1 = __Pyx_PyBytes_GET_SIZE(__pyx_v_ulid_bytes); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 28, __pyx_L1_error)
3378
+ __pyx_t_1 = __Pyx_PyBytes_GET_SIZE(__pyx_v_ulid_bytes); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 29, __pyx_L1_error)
3323
3379
  __pyx_t_2 = (__pyx_t_1 != 16);
3324
3380
  if (unlikely(__pyx_t_2)) {
3325
3381
 
3326
- /* "ulid_transform/_ulid_impl.pyx":29
3382
+ /* "ulid_transform/_ulid_impl.pyx":30
3327
3383
  * def _bytes_to_ulid(ulid_bytes: bytes) -> str:
3328
3384
  * if len(ulid_bytes) != 16:
3329
- * raise ValueError(f"ULID bytes be 16 bytes: {ulid_bytes}") # <<<<<<<<<<<<<<
3385
+ * raise ValueError(f"ULID bytes must be 16 bytes: {ulid_bytes!r}") # <<<<<<<<<<<<<<
3330
3386
  * return _cpp_bytes_to_ulid(ulid_bytes).decode("ascii")
3387
+ *
3331
3388
  */
3332
- __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_v_ulid_bytes, __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error)
3389
+ __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_ulid_bytes), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error)
3333
3390
  __Pyx_GOTREF(__pyx_t_3);
3334
- __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_ULID_bytes_be_16_bytes, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 29, __pyx_L1_error)
3391
+ __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_ULID_bytes_must_be_16_bytes, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 30, __pyx_L1_error)
3335
3392
  __Pyx_GOTREF(__pyx_t_4);
3336
3393
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3337
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error)
3394
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error)
3338
3395
  __Pyx_GOTREF(__pyx_t_3);
3339
3396
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3340
3397
  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
3341
3398
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3342
- __PYX_ERR(0, 29, __pyx_L1_error)
3399
+ __PYX_ERR(0, 30, __pyx_L1_error)
3343
3400
 
3344
- /* "ulid_transform/_ulid_impl.pyx":28
3401
+ /* "ulid_transform/_ulid_impl.pyx":29
3345
3402
  *
3346
3403
  * def _bytes_to_ulid(ulid_bytes: bytes) -> str:
3347
3404
  * if len(ulid_bytes) != 16: # <<<<<<<<<<<<<<
3348
- * raise ValueError(f"ULID bytes be 16 bytes: {ulid_bytes}")
3405
+ * raise ValueError(f"ULID bytes must be 16 bytes: {ulid_bytes!r}")
3349
3406
  * return _cpp_bytes_to_ulid(ulid_bytes).decode("ascii")
3350
3407
  */
3351
3408
  }
3352
3409
 
3353
- /* "ulid_transform/_ulid_impl.pyx":30
3410
+ /* "ulid_transform/_ulid_impl.pyx":31
3354
3411
  * if len(ulid_bytes) != 16:
3355
- * raise ValueError(f"ULID bytes be 16 bytes: {ulid_bytes}")
3412
+ * raise ValueError(f"ULID bytes must be 16 bytes: {ulid_bytes!r}")
3356
3413
  * return _cpp_bytes_to_ulid(ulid_bytes).decode("ascii") # <<<<<<<<<<<<<<
3414
+ *
3415
+ * def _ulid_to_bytes_or_none(ulid_str: Optional[str]) -> Optional[bytes]:
3357
3416
  */
3358
3417
  __Pyx_XDECREF(__pyx_r);
3359
- __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_v_ulid_bytes); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 30, __pyx_L1_error)
3360
- __pyx_t_3 = __Pyx_decode_cpp_string(_cpp_bytes_to_ulid(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_5)), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error)
3418
+ __pyx_t_5 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_v_ulid_bytes); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 31, __pyx_L1_error)
3419
+ __pyx_t_3 = __Pyx_decode_cpp_string(_cpp_bytes_to_ulid(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_5)), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error)
3361
3420
  __Pyx_GOTREF(__pyx_t_3);
3362
3421
  __pyx_r = ((PyObject*)__pyx_t_3);
3363
3422
  __pyx_t_3 = 0;
3364
3423
  goto __pyx_L0;
3365
3424
 
3366
- /* "ulid_transform/_ulid_impl.pyx":27
3425
+ /* "ulid_transform/_ulid_impl.pyx":28
3367
3426
  * return _cpp_ulid_to_bytes(ulid_str.encode("ascii"))
3368
3427
  *
3369
3428
  * def _bytes_to_ulid(ulid_bytes: bytes) -> str: # <<<<<<<<<<<<<<
3370
3429
  * if len(ulid_bytes) != 16:
3371
- * raise ValueError(f"ULID bytes be 16 bytes: {ulid_bytes}")
3430
+ * raise ValueError(f"ULID bytes must be 16 bytes: {ulid_bytes!r}")
3372
3431
  */
3373
3432
 
3374
3433
  /* function exit code */
@@ -3383,6 +3442,410 @@ static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl_6_bytes_to_ulid(CYTHON_U
3383
3442
  return __pyx_r;
3384
3443
  }
3385
3444
 
3445
+ /* "ulid_transform/_ulid_impl.pyx":33
3446
+ * return _cpp_bytes_to_ulid(ulid_bytes).decode("ascii")
3447
+ *
3448
+ * def _ulid_to_bytes_or_none(ulid_str: Optional[str]) -> Optional[bytes]: # <<<<<<<<<<<<<<
3449
+ * if ulid_str is None or len(ulid_str) != 26:
3450
+ * return None
3451
+ */
3452
+
3453
+ /* Python wrapper */
3454
+ static PyObject *__pyx_pw_14ulid_transform_10_ulid_impl_9_ulid_to_bytes_or_none(PyObject *__pyx_self,
3455
+ #if CYTHON_METH_FASTCALL
3456
+ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
3457
+ #else
3458
+ PyObject *__pyx_args, PyObject *__pyx_kwds
3459
+ #endif
3460
+ ); /*proto*/
3461
+ static PyMethodDef __pyx_mdef_14ulid_transform_10_ulid_impl_9_ulid_to_bytes_or_none = {"_ulid_to_bytes_or_none", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_14ulid_transform_10_ulid_impl_9_ulid_to_bytes_or_none, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
3462
+ static PyObject *__pyx_pw_14ulid_transform_10_ulid_impl_9_ulid_to_bytes_or_none(PyObject *__pyx_self,
3463
+ #if CYTHON_METH_FASTCALL
3464
+ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
3465
+ #else
3466
+ PyObject *__pyx_args, PyObject *__pyx_kwds
3467
+ #endif
3468
+ ) {
3469
+ PyObject *__pyx_v_ulid_str = 0;
3470
+ #if !CYTHON_METH_FASTCALL
3471
+ CYTHON_UNUSED Py_ssize_t __pyx_nargs;
3472
+ #endif
3473
+ CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
3474
+ PyObject* values[1] = {0};
3475
+ int __pyx_lineno = 0;
3476
+ const char *__pyx_filename = NULL;
3477
+ int __pyx_clineno = 0;
3478
+ PyObject *__pyx_r = 0;
3479
+ __Pyx_RefNannyDeclarations
3480
+ __Pyx_RefNannySetupContext("_ulid_to_bytes_or_none (wrapper)", 0);
3481
+ #if !CYTHON_METH_FASTCALL
3482
+ #if CYTHON_ASSUME_SAFE_MACROS
3483
+ __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
3484
+ #else
3485
+ __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
3486
+ #endif
3487
+ #endif
3488
+ __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
3489
+ {
3490
+ PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ulid_str,0};
3491
+ if (__pyx_kwds) {
3492
+ Py_ssize_t kw_args;
3493
+ switch (__pyx_nargs) {
3494
+ case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
3495
+ CYTHON_FALLTHROUGH;
3496
+ case 0: break;
3497
+ default: goto __pyx_L5_argtuple_error;
3498
+ }
3499
+ kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
3500
+ switch (__pyx_nargs) {
3501
+ case 0:
3502
+ if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ulid_str)) != 0)) {
3503
+ (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
3504
+ kw_args--;
3505
+ }
3506
+ else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 33, __pyx_L3_error)
3507
+ else goto __pyx_L5_argtuple_error;
3508
+ }
3509
+ if (unlikely(kw_args > 0)) {
3510
+ const Py_ssize_t kwd_pos_args = __pyx_nargs;
3511
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_ulid_to_bytes_or_none") < 0)) __PYX_ERR(0, 33, __pyx_L3_error)
3512
+ }
3513
+ } else if (unlikely(__pyx_nargs != 1)) {
3514
+ goto __pyx_L5_argtuple_error;
3515
+ } else {
3516
+ values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
3517
+ }
3518
+ __pyx_v_ulid_str = ((PyObject*)values[0]);
3519
+ }
3520
+ goto __pyx_L6_skip;
3521
+ __pyx_L5_argtuple_error:;
3522
+ __Pyx_RaiseArgtupleInvalid("_ulid_to_bytes_or_none", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 33, __pyx_L3_error)
3523
+ __pyx_L6_skip:;
3524
+ goto __pyx_L4_argument_unpacking_done;
3525
+ __pyx_L3_error:;
3526
+ {
3527
+ Py_ssize_t __pyx_temp;
3528
+ for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
3529
+ __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
3530
+ }
3531
+ }
3532
+ __Pyx_AddTraceback("ulid_transform._ulid_impl._ulid_to_bytes_or_none", __pyx_clineno, __pyx_lineno, __pyx_filename);
3533
+ __Pyx_RefNannyFinishContext();
3534
+ return NULL;
3535
+ __pyx_L4_argument_unpacking_done:;
3536
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ulid_str), (&PyUnicode_Type), 1, "ulid_str", 1))) __PYX_ERR(0, 33, __pyx_L1_error)
3537
+ __pyx_r = __pyx_pf_14ulid_transform_10_ulid_impl_8_ulid_to_bytes_or_none(__pyx_self, __pyx_v_ulid_str);
3538
+
3539
+ /* function exit code */
3540
+ goto __pyx_L0;
3541
+ __pyx_L1_error:;
3542
+ __pyx_r = NULL;
3543
+ __pyx_L0:;
3544
+ {
3545
+ Py_ssize_t __pyx_temp;
3546
+ for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
3547
+ __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
3548
+ }
3549
+ }
3550
+ __Pyx_RefNannyFinishContext();
3551
+ return __pyx_r;
3552
+ }
3553
+
3554
+ static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl_8_ulid_to_bytes_or_none(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ulid_str) {
3555
+ PyObject *__pyx_r = NULL;
3556
+ __Pyx_RefNannyDeclarations
3557
+ int __pyx_t_1;
3558
+ int __pyx_t_2;
3559
+ Py_ssize_t __pyx_t_3;
3560
+ PyObject *__pyx_t_4 = NULL;
3561
+ char const *__pyx_t_5;
3562
+ PyObject *__pyx_t_6 = NULL;
3563
+ int __pyx_lineno = 0;
3564
+ const char *__pyx_filename = NULL;
3565
+ int __pyx_clineno = 0;
3566
+ __Pyx_RefNannySetupContext("_ulid_to_bytes_or_none", 1);
3567
+
3568
+ /* "ulid_transform/_ulid_impl.pyx":34
3569
+ *
3570
+ * def _ulid_to_bytes_or_none(ulid_str: Optional[str]) -> Optional[bytes]:
3571
+ * if ulid_str is None or len(ulid_str) != 26: # <<<<<<<<<<<<<<
3572
+ * return None
3573
+ * return _cpp_ulid_to_bytes(ulid_str.encode("ascii"))
3574
+ */
3575
+ __pyx_t_2 = (__pyx_v_ulid_str == ((PyObject*)Py_None));
3576
+ if (!__pyx_t_2) {
3577
+ } else {
3578
+ __pyx_t_1 = __pyx_t_2;
3579
+ goto __pyx_L4_bool_binop_done;
3580
+ }
3581
+ if (unlikely(__pyx_v_ulid_str == Py_None)) {
3582
+ PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
3583
+ __PYX_ERR(0, 34, __pyx_L1_error)
3584
+ }
3585
+ __pyx_t_3 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_ulid_str); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 34, __pyx_L1_error)
3586
+ __pyx_t_2 = (__pyx_t_3 != 26);
3587
+ __pyx_t_1 = __pyx_t_2;
3588
+ __pyx_L4_bool_binop_done:;
3589
+ if (__pyx_t_1) {
3590
+
3591
+ /* "ulid_transform/_ulid_impl.pyx":35
3592
+ * def _ulid_to_bytes_or_none(ulid_str: Optional[str]) -> Optional[bytes]:
3593
+ * if ulid_str is None or len(ulid_str) != 26:
3594
+ * return None # <<<<<<<<<<<<<<
3595
+ * return _cpp_ulid_to_bytes(ulid_str.encode("ascii"))
3596
+ *
3597
+ */
3598
+ __Pyx_XDECREF(__pyx_r);
3599
+ __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
3600
+ goto __pyx_L0;
3601
+
3602
+ /* "ulid_transform/_ulid_impl.pyx":34
3603
+ *
3604
+ * def _ulid_to_bytes_or_none(ulid_str: Optional[str]) -> Optional[bytes]:
3605
+ * if ulid_str is None or len(ulid_str) != 26: # <<<<<<<<<<<<<<
3606
+ * return None
3607
+ * return _cpp_ulid_to_bytes(ulid_str.encode("ascii"))
3608
+ */
3609
+ }
3610
+
3611
+ /* "ulid_transform/_ulid_impl.pyx":36
3612
+ * if ulid_str is None or len(ulid_str) != 26:
3613
+ * return None
3614
+ * return _cpp_ulid_to_bytes(ulid_str.encode("ascii")) # <<<<<<<<<<<<<<
3615
+ *
3616
+ * def _bytes_to_ulid_or_none(ulid_bytes: Optional[bytes]) -> Optional[str]:
3617
+ */
3618
+ __Pyx_XDECREF(__pyx_r);
3619
+ if (unlikely(__pyx_v_ulid_str == Py_None)) {
3620
+ PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode");
3621
+ __PYX_ERR(0, 36, __pyx_L1_error)
3622
+ }
3623
+ __pyx_t_4 = PyUnicode_AsASCIIString(__pyx_v_ulid_str); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 36, __pyx_L1_error)
3624
+ __Pyx_GOTREF(__pyx_t_4);
3625
+ __pyx_t_5 = __Pyx_PyBytes_AsString(__pyx_t_4); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 36, __pyx_L1_error)
3626
+ __pyx_t_6 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(_cpp_ulid_to_bytes(__pyx_t_5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 36, __pyx_L1_error)
3627
+ __Pyx_GOTREF(__pyx_t_6);
3628
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3629
+ __pyx_r = ((PyObject*)__pyx_t_6);
3630
+ __pyx_t_6 = 0;
3631
+ goto __pyx_L0;
3632
+
3633
+ /* "ulid_transform/_ulid_impl.pyx":33
3634
+ * return _cpp_bytes_to_ulid(ulid_bytes).decode("ascii")
3635
+ *
3636
+ * def _ulid_to_bytes_or_none(ulid_str: Optional[str]) -> Optional[bytes]: # <<<<<<<<<<<<<<
3637
+ * if ulid_str is None or len(ulid_str) != 26:
3638
+ * return None
3639
+ */
3640
+
3641
+ /* function exit code */
3642
+ __pyx_L1_error:;
3643
+ __Pyx_XDECREF(__pyx_t_4);
3644
+ __Pyx_XDECREF(__pyx_t_6);
3645
+ __Pyx_AddTraceback("ulid_transform._ulid_impl._ulid_to_bytes_or_none", __pyx_clineno, __pyx_lineno, __pyx_filename);
3646
+ __pyx_r = NULL;
3647
+ __pyx_L0:;
3648
+ __Pyx_XGIVEREF(__pyx_r);
3649
+ __Pyx_RefNannyFinishContext();
3650
+ return __pyx_r;
3651
+ }
3652
+
3653
+ /* "ulid_transform/_ulid_impl.pyx":38
3654
+ * return _cpp_ulid_to_bytes(ulid_str.encode("ascii"))
3655
+ *
3656
+ * def _bytes_to_ulid_or_none(ulid_bytes: Optional[bytes]) -> Optional[str]: # <<<<<<<<<<<<<<
3657
+ * if ulid_bytes is None or len(ulid_bytes) != 16:
3658
+ * return None
3659
+ */
3660
+
3661
+ /* Python wrapper */
3662
+ static PyObject *__pyx_pw_14ulid_transform_10_ulid_impl_11_bytes_to_ulid_or_none(PyObject *__pyx_self,
3663
+ #if CYTHON_METH_FASTCALL
3664
+ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
3665
+ #else
3666
+ PyObject *__pyx_args, PyObject *__pyx_kwds
3667
+ #endif
3668
+ ); /*proto*/
3669
+ static PyMethodDef __pyx_mdef_14ulid_transform_10_ulid_impl_11_bytes_to_ulid_or_none = {"_bytes_to_ulid_or_none", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_14ulid_transform_10_ulid_impl_11_bytes_to_ulid_or_none, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
3670
+ static PyObject *__pyx_pw_14ulid_transform_10_ulid_impl_11_bytes_to_ulid_or_none(PyObject *__pyx_self,
3671
+ #if CYTHON_METH_FASTCALL
3672
+ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
3673
+ #else
3674
+ PyObject *__pyx_args, PyObject *__pyx_kwds
3675
+ #endif
3676
+ ) {
3677
+ PyObject *__pyx_v_ulid_bytes = 0;
3678
+ #if !CYTHON_METH_FASTCALL
3679
+ CYTHON_UNUSED Py_ssize_t __pyx_nargs;
3680
+ #endif
3681
+ CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
3682
+ PyObject* values[1] = {0};
3683
+ int __pyx_lineno = 0;
3684
+ const char *__pyx_filename = NULL;
3685
+ int __pyx_clineno = 0;
3686
+ PyObject *__pyx_r = 0;
3687
+ __Pyx_RefNannyDeclarations
3688
+ __Pyx_RefNannySetupContext("_bytes_to_ulid_or_none (wrapper)", 0);
3689
+ #if !CYTHON_METH_FASTCALL
3690
+ #if CYTHON_ASSUME_SAFE_MACROS
3691
+ __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
3692
+ #else
3693
+ __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
3694
+ #endif
3695
+ #endif
3696
+ __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
3697
+ {
3698
+ PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ulid_bytes,0};
3699
+ if (__pyx_kwds) {
3700
+ Py_ssize_t kw_args;
3701
+ switch (__pyx_nargs) {
3702
+ case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
3703
+ CYTHON_FALLTHROUGH;
3704
+ case 0: break;
3705
+ default: goto __pyx_L5_argtuple_error;
3706
+ }
3707
+ kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
3708
+ switch (__pyx_nargs) {
3709
+ case 0:
3710
+ if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ulid_bytes)) != 0)) {
3711
+ (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
3712
+ kw_args--;
3713
+ }
3714
+ else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 38, __pyx_L3_error)
3715
+ else goto __pyx_L5_argtuple_error;
3716
+ }
3717
+ if (unlikely(kw_args > 0)) {
3718
+ const Py_ssize_t kwd_pos_args = __pyx_nargs;
3719
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_bytes_to_ulid_or_none") < 0)) __PYX_ERR(0, 38, __pyx_L3_error)
3720
+ }
3721
+ } else if (unlikely(__pyx_nargs != 1)) {
3722
+ goto __pyx_L5_argtuple_error;
3723
+ } else {
3724
+ values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
3725
+ }
3726
+ __pyx_v_ulid_bytes = ((PyObject*)values[0]);
3727
+ }
3728
+ goto __pyx_L6_skip;
3729
+ __pyx_L5_argtuple_error:;
3730
+ __Pyx_RaiseArgtupleInvalid("_bytes_to_ulid_or_none", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 38, __pyx_L3_error)
3731
+ __pyx_L6_skip:;
3732
+ goto __pyx_L4_argument_unpacking_done;
3733
+ __pyx_L3_error:;
3734
+ {
3735
+ Py_ssize_t __pyx_temp;
3736
+ for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
3737
+ __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
3738
+ }
3739
+ }
3740
+ __Pyx_AddTraceback("ulid_transform._ulid_impl._bytes_to_ulid_or_none", __pyx_clineno, __pyx_lineno, __pyx_filename);
3741
+ __Pyx_RefNannyFinishContext();
3742
+ return NULL;
3743
+ __pyx_L4_argument_unpacking_done:;
3744
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ulid_bytes), (&PyBytes_Type), 1, "ulid_bytes", 1))) __PYX_ERR(0, 38, __pyx_L1_error)
3745
+ __pyx_r = __pyx_pf_14ulid_transform_10_ulid_impl_10_bytes_to_ulid_or_none(__pyx_self, __pyx_v_ulid_bytes);
3746
+
3747
+ /* function exit code */
3748
+ goto __pyx_L0;
3749
+ __pyx_L1_error:;
3750
+ __pyx_r = NULL;
3751
+ __pyx_L0:;
3752
+ {
3753
+ Py_ssize_t __pyx_temp;
3754
+ for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
3755
+ __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
3756
+ }
3757
+ }
3758
+ __Pyx_RefNannyFinishContext();
3759
+ return __pyx_r;
3760
+ }
3761
+
3762
+ static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl_10_bytes_to_ulid_or_none(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ulid_bytes) {
3763
+ PyObject *__pyx_r = NULL;
3764
+ __Pyx_RefNannyDeclarations
3765
+ int __pyx_t_1;
3766
+ int __pyx_t_2;
3767
+ Py_ssize_t __pyx_t_3;
3768
+ std::string __pyx_t_4;
3769
+ PyObject *__pyx_t_5 = NULL;
3770
+ int __pyx_lineno = 0;
3771
+ const char *__pyx_filename = NULL;
3772
+ int __pyx_clineno = 0;
3773
+ __Pyx_RefNannySetupContext("_bytes_to_ulid_or_none", 1);
3774
+
3775
+ /* "ulid_transform/_ulid_impl.pyx":39
3776
+ *
3777
+ * def _bytes_to_ulid_or_none(ulid_bytes: Optional[bytes]) -> Optional[str]:
3778
+ * if ulid_bytes is None or len(ulid_bytes) != 16: # <<<<<<<<<<<<<<
3779
+ * return None
3780
+ * return _cpp_bytes_to_ulid(ulid_bytes).decode("ascii")
3781
+ */
3782
+ __pyx_t_2 = (__pyx_v_ulid_bytes == ((PyObject*)Py_None));
3783
+ if (!__pyx_t_2) {
3784
+ } else {
3785
+ __pyx_t_1 = __pyx_t_2;
3786
+ goto __pyx_L4_bool_binop_done;
3787
+ }
3788
+ if (unlikely(__pyx_v_ulid_bytes == Py_None)) {
3789
+ PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
3790
+ __PYX_ERR(0, 39, __pyx_L1_error)
3791
+ }
3792
+ __pyx_t_3 = __Pyx_PyBytes_GET_SIZE(__pyx_v_ulid_bytes); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 39, __pyx_L1_error)
3793
+ __pyx_t_2 = (__pyx_t_3 != 16);
3794
+ __pyx_t_1 = __pyx_t_2;
3795
+ __pyx_L4_bool_binop_done:;
3796
+ if (__pyx_t_1) {
3797
+
3798
+ /* "ulid_transform/_ulid_impl.pyx":40
3799
+ * def _bytes_to_ulid_or_none(ulid_bytes: Optional[bytes]) -> Optional[str]:
3800
+ * if ulid_bytes is None or len(ulid_bytes) != 16:
3801
+ * return None # <<<<<<<<<<<<<<
3802
+ * return _cpp_bytes_to_ulid(ulid_bytes).decode("ascii")
3803
+ */
3804
+ __Pyx_XDECREF(__pyx_r);
3805
+ __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
3806
+ goto __pyx_L0;
3807
+
3808
+ /* "ulid_transform/_ulid_impl.pyx":39
3809
+ *
3810
+ * def _bytes_to_ulid_or_none(ulid_bytes: Optional[bytes]) -> Optional[str]:
3811
+ * if ulid_bytes is None or len(ulid_bytes) != 16: # <<<<<<<<<<<<<<
3812
+ * return None
3813
+ * return _cpp_bytes_to_ulid(ulid_bytes).decode("ascii")
3814
+ */
3815
+ }
3816
+
3817
+ /* "ulid_transform/_ulid_impl.pyx":41
3818
+ * if ulid_bytes is None or len(ulid_bytes) != 16:
3819
+ * return None
3820
+ * return _cpp_bytes_to_ulid(ulid_bytes).decode("ascii") # <<<<<<<<<<<<<<
3821
+ */
3822
+ __Pyx_XDECREF(__pyx_r);
3823
+ __pyx_t_4 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_v_ulid_bytes); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 41, __pyx_L1_error)
3824
+ __pyx_t_5 = __Pyx_decode_cpp_string(_cpp_bytes_to_ulid(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_4)), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 41, __pyx_L1_error)
3825
+ __Pyx_GOTREF(__pyx_t_5);
3826
+ __pyx_r = ((PyObject*)__pyx_t_5);
3827
+ __pyx_t_5 = 0;
3828
+ goto __pyx_L0;
3829
+
3830
+ /* "ulid_transform/_ulid_impl.pyx":38
3831
+ * return _cpp_ulid_to_bytes(ulid_str.encode("ascii"))
3832
+ *
3833
+ * def _bytes_to_ulid_or_none(ulid_bytes: Optional[bytes]) -> Optional[str]: # <<<<<<<<<<<<<<
3834
+ * if ulid_bytes is None or len(ulid_bytes) != 16:
3835
+ * return None
3836
+ */
3837
+
3838
+ /* function exit code */
3839
+ __pyx_L1_error:;
3840
+ __Pyx_XDECREF(__pyx_t_5);
3841
+ __Pyx_AddTraceback("ulid_transform._ulid_impl._bytes_to_ulid_or_none", __pyx_clineno, __pyx_lineno, __pyx_filename);
3842
+ __pyx_r = NULL;
3843
+ __pyx_L0:;
3844
+ __Pyx_XGIVEREF(__pyx_r);
3845
+ __Pyx_RefNannyFinishContext();
3846
+ return __pyx_r;
3847
+ }
3848
+
3386
3849
  static PyMethodDef __pyx_methods[] = {
3387
3850
  {0, 0, 0, 0}
3388
3851
  };
@@ -3400,13 +3863,17 @@ static PyMethodDef __pyx_methods[] = {
3400
3863
  static int __Pyx_CreateStringTabAndInitStrings(void) {
3401
3864
  __Pyx_StringTabEntry __pyx_string_tab[] = {
3402
3865
  {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0},
3403
- {&__pyx_kp_u_ULID_bytes_be_16_bytes, __pyx_k_ULID_bytes_be_16_bytes, sizeof(__pyx_k_ULID_bytes_be_16_bytes), 0, 1, 0, 0},
3866
+ {&__pyx_n_s_Optional, __pyx_k_Optional, sizeof(__pyx_k_Optional), 0, 0, 1, 1},
3867
+ {&__pyx_kp_s_Optional_bytes, __pyx_k_Optional_bytes, sizeof(__pyx_k_Optional_bytes), 0, 0, 1, 0},
3868
+ {&__pyx_kp_s_Optional_str, __pyx_k_Optional_str, sizeof(__pyx_k_Optional_str), 0, 0, 1, 0},
3869
+ {&__pyx_kp_u_ULID_bytes_must_be_16_bytes, __pyx_k_ULID_bytes_must_be_16_bytes, sizeof(__pyx_k_ULID_bytes_must_be_16_bytes), 0, 1, 0, 0},
3404
3870
  {&__pyx_kp_u_ULID_must_be_a_26_character_stri, __pyx_k_ULID_must_be_a_26_character_stri, sizeof(__pyx_k_ULID_must_be_a_26_character_stri), 0, 1, 0, 0},
3405
3871
  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
3406
- {&__pyx_n_s__9, __pyx_k__9, sizeof(__pyx_k__9), 0, 0, 1, 1},
3872
+ {&__pyx_n_s__11, __pyx_k__11, sizeof(__pyx_k__11), 0, 0, 1, 1},
3407
3873
  {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1},
3408
3874
  {&__pyx_n_s_bytes, __pyx_k_bytes, sizeof(__pyx_k_bytes), 0, 0, 1, 1},
3409
3875
  {&__pyx_n_s_bytes_to_ulid, __pyx_k_bytes_to_ulid, sizeof(__pyx_k_bytes_to_ulid), 0, 0, 1, 1},
3876
+ {&__pyx_n_s_bytes_to_ulid_or_none, __pyx_k_bytes_to_ulid_or_none, sizeof(__pyx_k_bytes_to_ulid_or_none), 0, 0, 1, 1},
3410
3877
  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
3411
3878
  {&__pyx_n_s_float, __pyx_k_float, sizeof(__pyx_k_float), 0, 0, 1, 1},
3412
3879
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
@@ -3419,11 +3886,13 @@ static int __Pyx_CreateStringTabAndInitStrings(void) {
3419
3886
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
3420
3887
  {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1},
3421
3888
  {&__pyx_n_s_time_2, __pyx_k_time_2, sizeof(__pyx_k_time_2), 0, 0, 1, 1},
3889
+ {&__pyx_n_s_typing, __pyx_k_typing, sizeof(__pyx_k_typing), 0, 0, 1, 1},
3422
3890
  {&__pyx_n_s_ulid_at_time, __pyx_k_ulid_at_time, sizeof(__pyx_k_ulid_at_time), 0, 0, 1, 1},
3423
3891
  {&__pyx_n_s_ulid_bytes, __pyx_k_ulid_bytes, sizeof(__pyx_k_ulid_bytes), 0, 0, 1, 1},
3424
3892
  {&__pyx_n_s_ulid_now, __pyx_k_ulid_now, sizeof(__pyx_k_ulid_now), 0, 0, 1, 1},
3425
3893
  {&__pyx_n_s_ulid_str, __pyx_k_ulid_str, sizeof(__pyx_k_ulid_str), 0, 0, 1, 1},
3426
3894
  {&__pyx_n_s_ulid_to_bytes, __pyx_k_ulid_to_bytes, sizeof(__pyx_k_ulid_to_bytes), 0, 0, 1, 1},
3895
+ {&__pyx_n_s_ulid_to_bytes_or_none, __pyx_k_ulid_to_bytes_or_none, sizeof(__pyx_k_ulid_to_bytes_or_none), 0, 0, 1, 1},
3427
3896
  {&__pyx_n_s_ulid_transform__ulid_impl, __pyx_k_ulid_transform__ulid_impl, sizeof(__pyx_k_ulid_transform__ulid_impl), 0, 0, 1, 1},
3428
3897
  {0, 0, 0, 0, 0, 0, 0}
3429
3898
  };
@@ -3431,7 +3900,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) {
3431
3900
  }
3432
3901
  /* #### Code section: cached_builtins ### */
3433
3902
  static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
3434
- __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 24, __pyx_L1_error)
3903
+ __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 25, __pyx_L1_error)
3435
3904
  return 0;
3436
3905
  __pyx_L1_error:;
3437
3906
  return -1;
@@ -3442,50 +3911,68 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
3442
3911
  __Pyx_RefNannyDeclarations
3443
3912
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
3444
3913
 
3445
- /* "ulid_transform/_ulid_impl.pyx":16
3914
+ /* "ulid_transform/_ulid_impl.pyx":17
3446
3915
  *
3447
3916
  *
3448
3917
  * def _ulid_now() -> str: # <<<<<<<<<<<<<<
3449
3918
  * return _cpp_ulid().decode("ascii")
3450
3919
  *
3451
3920
  */
3452
- __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_ulid_transform__ulid_impl_py, __pyx_n_s_ulid_now, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 16, __pyx_L1_error)
3921
+ __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_ulid_transform__ulid_impl_py, __pyx_n_s_ulid_now, 17, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 17, __pyx_L1_error)
3453
3922
 
3454
- /* "ulid_transform/_ulid_impl.pyx":19
3923
+ /* "ulid_transform/_ulid_impl.pyx":20
3455
3924
  * return _cpp_ulid().decode("ascii")
3456
3925
  *
3457
3926
  * def _ulid_at_time(_time: float) -> str: # <<<<<<<<<<<<<<
3458
3927
  * return _cpp_ulid_at_time(_time).decode("ascii")
3459
3928
  *
3460
3929
  */
3461
- __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_time); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 19, __pyx_L1_error)
3930
+ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_time); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 20, __pyx_L1_error)
3462
3931
  __Pyx_GOTREF(__pyx_tuple__3);
3463
3932
  __Pyx_GIVEREF(__pyx_tuple__3);
3464
- __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_ulid_transform__ulid_impl_py, __pyx_n_s_ulid_at_time, 19, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 19, __pyx_L1_error)
3933
+ __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_ulid_transform__ulid_impl_py, __pyx_n_s_ulid_at_time, 20, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 20, __pyx_L1_error)
3465
3934
 
3466
- /* "ulid_transform/_ulid_impl.pyx":22
3935
+ /* "ulid_transform/_ulid_impl.pyx":23
3467
3936
  * return _cpp_ulid_at_time(_time).decode("ascii")
3468
3937
  *
3469
3938
  * def _ulid_to_bytes(ulid_str: str) -> bytes: # <<<<<<<<<<<<<<
3470
3939
  * if len(ulid_str) != 26:
3471
3940
  * raise ValueError(f"ULID must be a 26 character string: {ulid_str}")
3472
3941
  */
3473
- __pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_ulid_str); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 22, __pyx_L1_error)
3942
+ __pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_ulid_str); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 23, __pyx_L1_error)
3474
3943
  __Pyx_GOTREF(__pyx_tuple__5);
3475
3944
  __Pyx_GIVEREF(__pyx_tuple__5);
3476
- __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_ulid_transform__ulid_impl_py, __pyx_n_s_ulid_to_bytes, 22, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 22, __pyx_L1_error)
3945
+ __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_ulid_transform__ulid_impl_py, __pyx_n_s_ulid_to_bytes, 23, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 23, __pyx_L1_error)
3477
3946
 
3478
- /* "ulid_transform/_ulid_impl.pyx":27
3947
+ /* "ulid_transform/_ulid_impl.pyx":28
3479
3948
  * return _cpp_ulid_to_bytes(ulid_str.encode("ascii"))
3480
3949
  *
3481
3950
  * def _bytes_to_ulid(ulid_bytes: bytes) -> str: # <<<<<<<<<<<<<<
3482
3951
  * if len(ulid_bytes) != 16:
3483
- * raise ValueError(f"ULID bytes be 16 bytes: {ulid_bytes}")
3952
+ * raise ValueError(f"ULID bytes must be 16 bytes: {ulid_bytes!r}")
3484
3953
  */
3485
- __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_ulid_bytes); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 27, __pyx_L1_error)
3954
+ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_ulid_bytes); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 28, __pyx_L1_error)
3486
3955
  __Pyx_GOTREF(__pyx_tuple__7);
3487
3956
  __Pyx_GIVEREF(__pyx_tuple__7);
3488
- __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_ulid_transform__ulid_impl_py, __pyx_n_s_bytes_to_ulid, 27, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 27, __pyx_L1_error)
3957
+ __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_ulid_transform__ulid_impl_py, __pyx_n_s_bytes_to_ulid, 28, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 28, __pyx_L1_error)
3958
+
3959
+ /* "ulid_transform/_ulid_impl.pyx":33
3960
+ * return _cpp_bytes_to_ulid(ulid_bytes).decode("ascii")
3961
+ *
3962
+ * def _ulid_to_bytes_or_none(ulid_str: Optional[str]) -> Optional[bytes]: # <<<<<<<<<<<<<<
3963
+ * if ulid_str is None or len(ulid_str) != 26:
3964
+ * return None
3965
+ */
3966
+ __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_ulid_transform__ulid_impl_py, __pyx_n_s_ulid_to_bytes_or_none, 33, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 33, __pyx_L1_error)
3967
+
3968
+ /* "ulid_transform/_ulid_impl.pyx":38
3969
+ * return _cpp_ulid_to_bytes(ulid_str.encode("ascii"))
3970
+ *
3971
+ * def _bytes_to_ulid_or_none(ulid_bytes: Optional[bytes]) -> Optional[str]: # <<<<<<<<<<<<<<
3972
+ * if ulid_bytes is None or len(ulid_bytes) != 16:
3973
+ * return None
3974
+ */
3975
+ __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_ulid_transform__ulid_impl_py, __pyx_n_s_bytes_to_ulid_or_none, 38, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 38, __pyx_L1_error)
3489
3976
  __Pyx_RefNannyFinishContext();
3490
3977
  return 0;
3491
3978
  __pyx_L1_error:;
@@ -3760,7 +4247,7 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec__ulid_impl(PyObject *__pyx_pyinit_
3760
4247
  __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
3761
4248
  {
3762
4249
  int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef);
3763
- __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to _ulid_impl pseudovariable */
4250
+ __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "_ulid_impl" pseudovariable */
3764
4251
  if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
3765
4252
  pystate_addmodule_run = 1;
3766
4253
  }
@@ -3772,10 +4259,8 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec__ulid_impl(PyObject *__pyx_pyinit_
3772
4259
  CYTHON_UNUSED_VAR(__pyx_t_1);
3773
4260
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
3774
4261
  Py_INCREF(__pyx_d);
3775
- __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
3776
- Py_INCREF(__pyx_b);
3777
- __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
3778
- Py_INCREF(__pyx_cython_runtime);
4262
+ __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
4263
+ __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
3779
4264
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3780
4265
  #if CYTHON_REFNANNY
3781
4266
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
@@ -3856,8 +4341,8 @@ if (!__Pyx_RefNanny) {
3856
4341
  * from libcpp.string cimport string
3857
4342
  *
3858
4343
  * from time import time # <<<<<<<<<<<<<<
4344
+ * from typing import Optional
3859
4345
  *
3860
- * import cython
3861
4346
  */
3862
4347
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error)
3863
4348
  __Pyx_GOTREF(__pyx_t_2);
@@ -3873,86 +4358,143 @@ if (!__Pyx_RefNanny) {
3873
4358
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3874
4359
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3875
4360
 
3876
- /* "ulid_transform/_ulid_impl.pyx":16
4361
+ /* "ulid_transform/_ulid_impl.pyx":5
4362
+ *
4363
+ * from time import time
4364
+ * from typing import Optional # <<<<<<<<<<<<<<
4365
+ *
4366
+ * import cython
4367
+ */
4368
+ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error)
4369
+ __Pyx_GOTREF(__pyx_t_3);
4370
+ __Pyx_INCREF(__pyx_n_s_Optional);
4371
+ __Pyx_GIVEREF(__pyx_n_s_Optional);
4372
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_Optional)) __PYX_ERR(0, 5, __pyx_L1_error);
4373
+ __pyx_t_2 = __Pyx_Import(__pyx_n_s_typing, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error)
4374
+ __Pyx_GOTREF(__pyx_t_2);
4375
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4376
+ __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Optional); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error)
4377
+ __Pyx_GOTREF(__pyx_t_3);
4378
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_Optional, __pyx_t_3) < 0) __PYX_ERR(0, 5, __pyx_L1_error)
4379
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4380
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4381
+
4382
+ /* "ulid_transform/_ulid_impl.pyx":17
3877
4383
  *
3878
4384
  *
3879
4385
  * def _ulid_now() -> str: # <<<<<<<<<<<<<<
3880
4386
  * return _cpp_ulid().decode("ascii")
3881
4387
  *
3882
4388
  */
3883
- __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 16, __pyx_L1_error)
3884
- __Pyx_GOTREF(__pyx_t_3);
3885
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
3886
- __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_14ulid_transform_10_ulid_impl_1_ulid_now, 0, __pyx_n_s_ulid_now, NULL, __pyx_n_s_ulid_transform__ulid_impl, __pyx_d, ((PyObject *)__pyx_codeobj__2)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error)
4389
+ __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error)
3887
4390
  __Pyx_GOTREF(__pyx_t_2);
3888
- __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3);
3889
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3890
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ulid_now, __pyx_t_2) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
4391
+ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
4392
+ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_14ulid_transform_10_ulid_impl_1_ulid_now, 0, __pyx_n_s_ulid_now, NULL, __pyx_n_s_ulid_transform__ulid_impl, __pyx_d, ((PyObject *)__pyx_codeobj__2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 17, __pyx_L1_error)
4393
+ __Pyx_GOTREF(__pyx_t_3);
4394
+ __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2);
3891
4395
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4396
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ulid_now, __pyx_t_3) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
4397
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3892
4398
 
3893
- /* "ulid_transform/_ulid_impl.pyx":19
4399
+ /* "ulid_transform/_ulid_impl.pyx":20
3894
4400
  * return _cpp_ulid().decode("ascii")
3895
4401
  *
3896
4402
  * def _ulid_at_time(_time: float) -> str: # <<<<<<<<<<<<<<
3897
4403
  * return _cpp_ulid_at_time(_time).decode("ascii")
3898
4404
  *
3899
4405
  */
3900
- __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error)
3901
- __Pyx_GOTREF(__pyx_t_2);
3902
- if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_time, __pyx_n_s_float) < 0) __PYX_ERR(0, 19, __pyx_L1_error)
3903
- if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 19, __pyx_L1_error)
3904
- __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_14ulid_transform_10_ulid_impl_3_ulid_at_time, 0, __pyx_n_s_ulid_at_time, NULL, __pyx_n_s_ulid_transform__ulid_impl, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 19, __pyx_L1_error)
4406
+ __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 20, __pyx_L1_error)
3905
4407
  __Pyx_GOTREF(__pyx_t_3);
3906
- __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2);
3907
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3908
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ulid_at_time, __pyx_t_3) < 0) __PYX_ERR(0, 19, __pyx_L1_error)
4408
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_time, __pyx_n_s_float) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
4409
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
4410
+ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_14ulid_transform_10_ulid_impl_3_ulid_at_time, 0, __pyx_n_s_ulid_at_time, NULL, __pyx_n_s_ulid_transform__ulid_impl, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error)
4411
+ __Pyx_GOTREF(__pyx_t_2);
4412
+ __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3);
3909
4413
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4414
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ulid_at_time, __pyx_t_2) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
4415
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3910
4416
 
3911
- /* "ulid_transform/_ulid_impl.pyx":22
4417
+ /* "ulid_transform/_ulid_impl.pyx":23
3912
4418
  * return _cpp_ulid_at_time(_time).decode("ascii")
3913
4419
  *
3914
4420
  * def _ulid_to_bytes(ulid_str: str) -> bytes: # <<<<<<<<<<<<<<
3915
4421
  * if len(ulid_str) != 26:
3916
4422
  * raise ValueError(f"ULID must be a 26 character string: {ulid_str}")
3917
4423
  */
3918
- __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 22, __pyx_L1_error)
3919
- __Pyx_GOTREF(__pyx_t_3);
3920
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_ulid_str, __pyx_n_s_str) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
3921
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_bytes) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
3922
- __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_14ulid_transform_10_ulid_impl_5_ulid_to_bytes, 0, __pyx_n_s_ulid_to_bytes, NULL, __pyx_n_s_ulid_transform__ulid_impl, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error)
4424
+ __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error)
3923
4425
  __Pyx_GOTREF(__pyx_t_2);
3924
- __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3);
3925
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3926
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ulid_to_bytes, __pyx_t_2) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
4426
+ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ulid_str, __pyx_n_s_str) < 0) __PYX_ERR(0, 23, __pyx_L1_error)
4427
+ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_bytes) < 0) __PYX_ERR(0, 23, __pyx_L1_error)
4428
+ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_14ulid_transform_10_ulid_impl_5_ulid_to_bytes, 0, __pyx_n_s_ulid_to_bytes, NULL, __pyx_n_s_ulid_transform__ulid_impl, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 23, __pyx_L1_error)
4429
+ __Pyx_GOTREF(__pyx_t_3);
4430
+ __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2);
3927
4431
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4432
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ulid_to_bytes, __pyx_t_3) < 0) __PYX_ERR(0, 23, __pyx_L1_error)
4433
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3928
4434
 
3929
- /* "ulid_transform/_ulid_impl.pyx":27
4435
+ /* "ulid_transform/_ulid_impl.pyx":28
3930
4436
  * return _cpp_ulid_to_bytes(ulid_str.encode("ascii"))
3931
4437
  *
3932
4438
  * def _bytes_to_ulid(ulid_bytes: bytes) -> str: # <<<<<<<<<<<<<<
3933
4439
  * if len(ulid_bytes) != 16:
3934
- * raise ValueError(f"ULID bytes be 16 bytes: {ulid_bytes}")
4440
+ * raise ValueError(f"ULID bytes must be 16 bytes: {ulid_bytes!r}")
4441
+ */
4442
+ __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error)
4443
+ __Pyx_GOTREF(__pyx_t_3);
4444
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_ulid_bytes, __pyx_n_s_bytes) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
4445
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
4446
+ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_14ulid_transform_10_ulid_impl_7_bytes_to_ulid, 0, __pyx_n_s_bytes_to_ulid, NULL, __pyx_n_s_ulid_transform__ulid_impl, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
4447
+ __Pyx_GOTREF(__pyx_t_2);
4448
+ __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3);
4449
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4450
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_bytes_to_ulid, __pyx_t_2) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
4451
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4452
+
4453
+ /* "ulid_transform/_ulid_impl.pyx":33
4454
+ * return _cpp_bytes_to_ulid(ulid_bytes).decode("ascii")
4455
+ *
4456
+ * def _ulid_to_bytes_or_none(ulid_str: Optional[str]) -> Optional[bytes]: # <<<<<<<<<<<<<<
4457
+ * if ulid_str is None or len(ulid_str) != 26:
4458
+ * return None
3935
4459
  */
3936
- __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
4460
+ __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error)
3937
4461
  __Pyx_GOTREF(__pyx_t_2);
3938
- if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ulid_bytes, __pyx_n_s_bytes) < 0) __PYX_ERR(0, 27, __pyx_L1_error)
3939
- if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 27, __pyx_L1_error)
3940
- __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_14ulid_transform_10_ulid_impl_7_bytes_to_ulid, 0, __pyx_n_s_bytes_to_ulid, NULL, __pyx_n_s_ulid_transform__ulid_impl, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __pyx_L1_error)
4462
+ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ulid_str, __pyx_kp_s_Optional_str) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
4463
+ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_kp_s_Optional_bytes) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
4464
+ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_14ulid_transform_10_ulid_impl_9_ulid_to_bytes_or_none, 0, __pyx_n_s_ulid_to_bytes_or_none, NULL, __pyx_n_s_ulid_transform__ulid_impl, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error)
3941
4465
  __Pyx_GOTREF(__pyx_t_3);
3942
4466
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2);
3943
4467
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3944
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_bytes_to_ulid, __pyx_t_3) < 0) __PYX_ERR(0, 27, __pyx_L1_error)
4468
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ulid_to_bytes_or_none, __pyx_t_3) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
4469
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4470
+
4471
+ /* "ulid_transform/_ulid_impl.pyx":38
4472
+ * return _cpp_ulid_to_bytes(ulid_str.encode("ascii"))
4473
+ *
4474
+ * def _bytes_to_ulid_or_none(ulid_bytes: Optional[bytes]) -> Optional[str]: # <<<<<<<<<<<<<<
4475
+ * if ulid_bytes is None or len(ulid_bytes) != 16:
4476
+ * return None
4477
+ */
4478
+ __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 38, __pyx_L1_error)
4479
+ __Pyx_GOTREF(__pyx_t_3);
4480
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_ulid_bytes, __pyx_kp_s_Optional_bytes) < 0) __PYX_ERR(0, 38, __pyx_L1_error)
4481
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Optional_str) < 0) __PYX_ERR(0, 38, __pyx_L1_error)
4482
+ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_14ulid_transform_10_ulid_impl_11_bytes_to_ulid_or_none, 0, __pyx_n_s_bytes_to_ulid_or_none, NULL, __pyx_n_s_ulid_transform__ulid_impl, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L1_error)
4483
+ __Pyx_GOTREF(__pyx_t_2);
4484
+ __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3);
3945
4485
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4486
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_bytes_to_ulid_or_none, __pyx_t_2) < 0) __PYX_ERR(0, 38, __pyx_L1_error)
4487
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3946
4488
 
3947
4489
  /* "ulid_transform/_ulid_impl.pyx":1
3948
4490
  * # distutils: language = c++ # <<<<<<<<<<<<<<
3949
4491
  * from libcpp.string cimport string
3950
4492
  *
3951
4493
  */
3952
- __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error)
3953
- __Pyx_GOTREF(__pyx_t_3);
3954
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3955
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4494
+ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
4495
+ __Pyx_GOTREF(__pyx_t_2);
4496
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4497
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3956
4498
 
3957
4499
  /*--- Wrapped vars code ---*/
3958
4500
 
@@ -4140,14 +4682,20 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject
4140
4682
  #endif
4141
4683
 
4142
4684
  /* PyObjectGetAttrStrNoError */
4685
+ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1
4143
4686
  static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
4144
4687
  __Pyx_PyThreadState_declare
4145
4688
  __Pyx_PyThreadState_assign
4146
4689
  if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
4147
4690
  __Pyx_PyErr_Clear();
4148
4691
  }
4692
+ #endif
4149
4693
  static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
4150
4694
  PyObject *result;
4695
+ #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
4696
+ (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
4697
+ return result;
4698
+ #else
4151
4699
  #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
4152
4700
  PyTypeObject* tp = Py_TYPE(obj);
4153
4701
  if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
@@ -4159,6 +4707,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, P
4159
4707
  __Pyx_PyObject_GetAttrStr_ClearAttributeError();
4160
4708
  }
4161
4709
  return result;
4710
+ #endif
4162
4711
  }
4163
4712
 
4164
4713
  /* GetBuiltinName */
@@ -4374,13 +4923,31 @@ static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyO
4374
4923
  {
4375
4924
  int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ);
4376
4925
  if (unlikely(eq != 0)) {
4377
- if (unlikely(eq < 0)) return NULL; // error
4926
+ if (unlikely(eq < 0)) return NULL;
4378
4927
  return kwvalues[i];
4379
4928
  }
4380
4929
  }
4381
- return NULL; // not found (no exception set)
4930
+ return NULL;
4931
+ }
4932
+ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
4933
+ CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
4934
+ Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames);
4935
+ PyObject *dict;
4936
+ dict = PyDict_New();
4937
+ if (unlikely(!dict))
4938
+ return NULL;
4939
+ for (i=0; i<nkwargs; i++) {
4940
+ PyObject *key = PyTuple_GET_ITEM(kwnames, i);
4941
+ if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
4942
+ goto bad;
4943
+ }
4944
+ return dict;
4945
+ bad:
4946
+ Py_DECREF(dict);
4947
+ return NULL;
4382
4948
  }
4383
4949
  #endif
4950
+ #endif
4384
4951
 
4385
4952
  /* decode_c_bytes */
4386
4953
  static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
@@ -4474,7 +5041,7 @@ static int __Pyx_ParseOptionalKeywords(
4474
5041
  if (*name) {
4475
5042
  values[name-argnames] = value;
4476
5043
  #if CYTHON_AVOID_BORROWED_REFS
4477
- Py_INCREF(value); // transfer ownership of value to values
5044
+ Py_INCREF(value);
4478
5045
  Py_DECREF(key);
4479
5046
  #endif
4480
5047
  key = NULL;
@@ -4493,7 +5060,7 @@ static int __Pyx_ParseOptionalKeywords(
4493
5060
  && _PyString_Eq(**name, key)) {
4494
5061
  values[name-argnames] = value;
4495
5062
  #if CYTHON_AVOID_BORROWED_REFS
4496
- value = NULL; // ownership transferred to values
5063
+ value = NULL;
4497
5064
  #endif
4498
5065
  break;
4499
5066
  }
@@ -4525,7 +5092,7 @@ static int __Pyx_ParseOptionalKeywords(
4525
5092
  if (cmp == 0) {
4526
5093
  values[name-argnames] = value;
4527
5094
  #if CYTHON_AVOID_BORROWED_REFS
4528
- value = NULL; // ownership transferred to values
5095
+ value = NULL;
4529
5096
  #endif
4530
5097
  break;
4531
5098
  }
@@ -4677,9 +5244,15 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
4677
5244
  PyObject *result;
4678
5245
  assert(kwargs == NULL || PyDict_Check(kwargs));
4679
5246
  nk = kwargs ? PyDict_Size(kwargs) : 0;
5247
+ #if PY_MAJOR_VERSION < 3
4680
5248
  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) {
4681
5249
  return NULL;
4682
5250
  }
5251
+ #else
5252
+ if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) {
5253
+ return NULL;
5254
+ }
5255
+ #endif
4683
5256
  if (
4684
5257
  #if PY_MAJOR_VERSION >= 3
4685
5258
  co->co_kwonlyargcount == 0 &&
@@ -4756,8 +5329,13 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg
4756
5329
  ternaryfunc call = Py_TYPE(func)->tp_call;
4757
5330
  if (unlikely(!call))
4758
5331
  return PyObject_Call(func, arg, kw);
5332
+ #if PY_MAJOR_VERSION < 3
4759
5333
  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
4760
5334
  return NULL;
5335
+ #else
5336
+ if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
5337
+ return NULL;
5338
+ #endif
4761
5339
  result = (*call)(func, arg, kw);
4762
5340
  Py_LeaveRecursiveCall();
4763
5341
  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
@@ -4776,8 +5354,13 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject
4776
5354
  PyCFunction cfunc;
4777
5355
  cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
4778
5356
  self = __Pyx_CyOrPyCFunction_GET_SELF(func);
5357
+ #if PY_MAJOR_VERSION < 3
4779
5358
  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
4780
5359
  return NULL;
5360
+ #else
5361
+ if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
5362
+ return NULL;
5363
+ #endif
4781
5364
  result = cfunc(self, arg);
4782
5365
  Py_LeaveRecursiveCall();
4783
5366
  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
@@ -4842,7 +5425,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj
4842
5425
  #endif
4843
5426
  if (kwargs == NULL) {
4844
5427
  #if CYTHON_VECTORCALL
4845
- #if Py_VERSION_HEX < 0x03090000
5428
+ #if PY_VERSION_HEX < 0x03090000
4846
5429
  vectorcallfunc f = _PyVectorcall_Function(func);
4847
5430
  #else
4848
5431
  vectorcallfunc f = PyVectorcall_Function(func);
@@ -5034,6 +5617,27 @@ bad:
5034
5617
  }
5035
5618
  #endif
5036
5619
 
5620
+ /* PyObjectFormatAndDecref */
5621
+ static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) {
5622
+ if (unlikely(!s)) return NULL;
5623
+ if (likely(PyUnicode_CheckExact(s))) return s;
5624
+ #if PY_MAJOR_VERSION < 3
5625
+ if (likely(PyString_CheckExact(s))) {
5626
+ PyObject *result = PyUnicode_FromEncodedObject(s, NULL, "strict");
5627
+ Py_DECREF(s);
5628
+ return result;
5629
+ }
5630
+ #endif
5631
+ return __Pyx_PyObject_FormatAndDecref(s, f);
5632
+ }
5633
+ static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) {
5634
+ PyObject *result;
5635
+ if (unlikely(!s)) return NULL;
5636
+ result = PyObject_Format(s, f);
5637
+ Py_DECREF(s);
5638
+ return result;
5639
+ }
5640
+
5037
5641
  /* Import */
5038
5642
  static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
5039
5643
  PyObject *module = 0;
@@ -5210,10 +5814,7 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject
5210
5814
 
5211
5815
  /* FetchSharedCythonModule */
5212
5816
  static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
5213
- PyObject *abi_module = PyImport_AddModule((char*) __PYX_ABI_MODULE_NAME);
5214
- if (unlikely(!abi_module)) return NULL;
5215
- Py_INCREF(abi_module);
5216
- return abi_module;
5817
+ return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME);
5217
5818
  }
5218
5819
 
5219
5820
  /* FetchCommonType */
@@ -6197,7 +6798,7 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func,
6197
6798
  default:
6198
6799
  return NULL;
6199
6800
  }
6200
- return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames);
6801
+ return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames);
6201
6802
  }
6202
6803
  static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
6203
6804
  {
@@ -6562,8 +7163,8 @@ static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject
6562
7163
  Py_DECREF(replace);
6563
7164
  return result;
6564
7165
  }
6565
- #if __PYX_LIMITED_VERSION_HEX < 0x030780000
6566
7166
  PyErr_Clear();
7167
+ #if __PYX_LIMITED_VERSION_HEX < 0x030780000
6567
7168
  {
6568
7169
  PyObject *compiled = NULL, *result = NULL;
6569
7170
  if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL;
@@ -6583,6 +7184,8 @@ static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject
6583
7184
  if (result) Py_INCREF(result);
6584
7185
  return result;
6585
7186
  }
7187
+ #else
7188
+ return NULL;
6586
7189
  #endif
6587
7190
  }
6588
7191
  static void __Pyx_AddTraceback(const char *funcname, int c_line,
@@ -6680,7 +7283,7 @@ static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
6680
7283
  #else
6681
7284
  py_code = PyCode_NewEmpty(filename, funcname, py_line);
6682
7285
  #endif
6683
- Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline
7286
+ Py_XDECREF(py_funcname);
6684
7287
  return py_code;
6685
7288
  bad:
6686
7289
  Py_XDECREF(py_funcname);
@@ -6739,7 +7342,7 @@ __Pyx_PyType_GetName(PyTypeObject* tp)
6739
7342
  if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) {
6740
7343
  PyErr_Clear();
6741
7344
  Py_XDECREF(name);
6742
- name = __Pyx_NewRef(__pyx_n_s__9);
7345
+ name = __Pyx_NewRef(__pyx_n_s__11);
6743
7346
  }
6744
7347
  return name;
6745
7348
  }
@@ -6778,13 +7381,13 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
6778
7381
  {
6779
7382
  int one = 1; int little = (int)*(unsigned char *)&one;
6780
7383
  unsigned char *bytes = (unsigned char *)&value;
6781
- #if !CYTHON_COMPILING_IN_LIMITED_API
7384
+ #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
6782
7385
  return _PyLong_FromByteArray(bytes, sizeof(long),
6783
7386
  little, !is_unsigned);
6784
7387
  #else
6785
7388
  PyObject *from_bytes, *result = NULL;
6786
7389
  PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
6787
- from_bytes = PyObject_GetAttrString((PyObject*)&PyInt_Type, "from_bytes");
7390
+ from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
6788
7391
  if (!from_bytes) return NULL;
6789
7392
  py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long));
6790
7393
  if (!py_bytes) goto limited_bad;
@@ -6792,16 +7395,18 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
6792
7395
  if (!order_str) goto limited_bad;
6793
7396
  arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
6794
7397
  if (!arg_tuple) goto limited_bad;
6795
- kwds = PyDict_New();
6796
- if (!kwds) goto limited_bad;
6797
- if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(!is_unsigned ? Py_True : Py_False))) goto limited_bad;
7398
+ if (!is_unsigned) {
7399
+ kwds = PyDict_New();
7400
+ if (!kwds) goto limited_bad;
7401
+ if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
7402
+ }
6798
7403
  result = PyObject_Call(from_bytes, arg_tuple, kwds);
6799
7404
  limited_bad:
6800
- Py_XDECREF(from_bytes);
6801
- Py_XDECREF(py_bytes);
6802
- Py_XDECREF(order_str);
6803
- Py_XDECREF(arg_tuple);
6804
7405
  Py_XDECREF(kwds);
7406
+ Py_XDECREF(arg_tuple);
7407
+ Py_XDECREF(order_str);
7408
+ Py_XDECREF(py_bytes);
7409
+ Py_XDECREF(from_bytes);
6805
7410
  return result;
6806
7411
  #endif
6807
7412
  }
@@ -6999,7 +7604,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
6999
7604
  #endif
7000
7605
  if (likely(v)) {
7001
7606
  int ret = -1;
7002
- #if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
7607
+ #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
7003
7608
  int one = 1; int is_little = (int)*(unsigned char *)&one;
7004
7609
  unsigned char *bytes = (unsigned char *)&val;
7005
7610
  ret = _PyLong_AsByteArray((PyLongObject *)v,
@@ -7272,7 +7877,7 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
7272
7877
  #endif
7273
7878
  if (likely(v)) {
7274
7879
  int ret = -1;
7275
- #if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
7880
+ #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
7276
7881
  int one = 1; int is_little = (int)*(unsigned char *)&one;
7277
7882
  unsigned char *bytes = (unsigned char *)&val;
7278
7883
  ret = _PyLong_AsByteArray((PyLongObject *)v,
@@ -7492,7 +8097,7 @@ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObj
7492
8097
  #endif
7493
8098
 
7494
8099
  /* CheckBinaryVersion */
7495
- static unsigned long __Pyx_get_runtime_version() {
8100
+ static unsigned long __Pyx_get_runtime_version(void) {
7496
8101
  #if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4
7497
8102
  return Py_Version & ~0xFFUL;
7498
8103
  #else