ulid-transform 0.9.0__cp312-cp312-win32.whl → 0.10.1__cp312-cp312-win32.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
@@ -1944,7 +1978,7 @@ typedef struct {
1944
1978
  #endif
1945
1979
  void *defaults;
1946
1980
  int defaults_pyobjects;
1947
- size_t defaults_size; // used by FusedFunction for copying defaults
1981
+ size_t defaults_size;
1948
1982
  int flags;
1949
1983
  PyObject *defaults_tuple;
1950
1984
  PyObject *defaults_kwdict;
@@ -2150,12 +2184,12 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2150
2184
  /* Module declarations from "cython" */
2151
2185
 
2152
2186
  /* 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*/
2187
+ static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string(std::string const &); /*proto*/
2188
+ static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(std::string const &); /*proto*/
2189
+ static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string(std::string const &); /*proto*/
2190
+ static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(std::string const &); /*proto*/
2191
+ static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string(std::string const &); /*proto*/
2192
+ static std::string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(PyObject *); /*proto*/
2159
2193
  /* #### Code section: typeinfo ### */
2160
2194
  /* #### Code section: before_global_var ### */
2161
2195
  #define __Pyx_MODULE_NAME "ulid_transform._ulid_impl"
@@ -2167,7 +2201,7 @@ int __pyx_module_is_main_ulid_transform___ulid_impl = 0;
2167
2201
  static PyObject *__pyx_builtin_ValueError;
2168
2202
  /* #### Code section: string_decls ### */
2169
2203
  static const char __pyx_k_[] = ".";
2170
- static const char __pyx_k__9[] = "?";
2204
+ static const char __pyx_k__11[] = "?";
2171
2205
  static const char __pyx_k_str[] = "str";
2172
2206
  static const char __pyx_k_main[] = "__main__";
2173
2207
  static const char __pyx_k_name[] = "__name__";
@@ -2178,16 +2212,22 @@ static const char __pyx_k_float[] = "float";
2178
2212
  static const char __pyx_k_import[] = "__import__";
2179
2213
  static const char __pyx_k_return[] = "return";
2180
2214
  static const char __pyx_k_time_2[] = "time";
2215
+ static const char __pyx_k_typing[] = "typing";
2216
+ static const char __pyx_k_Optional[] = "Optional";
2181
2217
  static const char __pyx_k_ulid_now[] = "_ulid_now";
2182
2218
  static const char __pyx_k_ulid_str[] = "ulid_str";
2183
2219
  static const char __pyx_k_ValueError[] = "ValueError";
2184
2220
  static const char __pyx_k_ulid_bytes[] = "ulid_bytes";
2221
+ static const char __pyx_k_Optional_str[] = "Optional[str]";
2185
2222
  static const char __pyx_k_is_coroutine[] = "_is_coroutine";
2186
2223
  static const char __pyx_k_ulid_at_time[] = "_ulid_at_time";
2187
2224
  static const char __pyx_k_bytes_to_ulid[] = "_bytes_to_ulid";
2188
2225
  static const char __pyx_k_ulid_to_bytes[] = "_ulid_to_bytes";
2226
+ static const char __pyx_k_Optional_bytes[] = "Optional[bytes]";
2189
2227
  static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines";
2190
2228
  static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2229
+ static const char __pyx_k_bytes_to_ulid_or_none[] = "_bytes_to_ulid_or_none";
2230
+ static const char __pyx_k_ulid_to_bytes_or_none[] = "_ulid_to_bytes_or_none";
2191
2231
  static const char __pyx_k_ULID_bytes_be_16_bytes[] = "ULID bytes be 16 bytes: ";
2192
2232
  static const char __pyx_k_ulid_transform__ulid_impl[] = "ulid_transform._ulid_impl";
2193
2233
  static const char __pyx_k_ULID_must_be_a_26_character_stri[] = "ULID must be a 26 character string: ";
@@ -2197,6 +2237,8 @@ static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl__ulid_now(CYTHON_UNUSED
2197
2237
  static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl_2_ulid_at_time(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v__time); /* proto */
2198
2238
  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
2239
  static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl_6_bytes_to_ulid(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ulid_bytes); /* proto */
2240
+ 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 */
2241
+ 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
2242
  /* #### Code section: late_includes ### */
2201
2243
  /* #### Code section: module_state ### */
2202
2244
  typedef struct {
@@ -2233,13 +2275,17 @@ typedef struct {
2233
2275
  #if CYTHON_USE_MODULE_STATE
2234
2276
  #endif
2235
2277
  PyObject *__pyx_kp_u_;
2278
+ PyObject *__pyx_n_s_Optional;
2279
+ PyObject *__pyx_kp_s_Optional_bytes;
2280
+ PyObject *__pyx_kp_s_Optional_str;
2236
2281
  PyObject *__pyx_kp_u_ULID_bytes_be_16_bytes;
2237
2282
  PyObject *__pyx_kp_u_ULID_must_be_a_26_character_stri;
2238
2283
  PyObject *__pyx_n_s_ValueError;
2239
- PyObject *__pyx_n_s__9;
2284
+ PyObject *__pyx_n_s__11;
2240
2285
  PyObject *__pyx_n_s_asyncio_coroutines;
2241
2286
  PyObject *__pyx_n_s_bytes;
2242
2287
  PyObject *__pyx_n_s_bytes_to_ulid;
2288
+ PyObject *__pyx_n_s_bytes_to_ulid_or_none;
2243
2289
  PyObject *__pyx_n_s_cline_in_traceback;
2244
2290
  PyObject *__pyx_n_s_float;
2245
2291
  PyObject *__pyx_n_s_import;
@@ -2252,11 +2298,13 @@ typedef struct {
2252
2298
  PyObject *__pyx_n_s_test;
2253
2299
  PyObject *__pyx_n_s_time;
2254
2300
  PyObject *__pyx_n_s_time_2;
2301
+ PyObject *__pyx_n_s_typing;
2255
2302
  PyObject *__pyx_n_s_ulid_at_time;
2256
2303
  PyObject *__pyx_n_s_ulid_bytes;
2257
2304
  PyObject *__pyx_n_s_ulid_now;
2258
2305
  PyObject *__pyx_n_s_ulid_str;
2259
2306
  PyObject *__pyx_n_s_ulid_to_bytes;
2307
+ PyObject *__pyx_n_s_ulid_to_bytes_or_none;
2260
2308
  PyObject *__pyx_n_s_ulid_transform__ulid_impl;
2261
2309
  PyObject *__pyx_tuple__3;
2262
2310
  PyObject *__pyx_tuple__5;
@@ -2265,6 +2313,8 @@ typedef struct {
2265
2313
  PyObject *__pyx_codeobj__4;
2266
2314
  PyObject *__pyx_codeobj__6;
2267
2315
  PyObject *__pyx_codeobj__8;
2316
+ PyObject *__pyx_codeobj__9;
2317
+ PyObject *__pyx_codeobj__10;
2268
2318
  } __pyx_mstate;
2269
2319
 
2270
2320
  #if CYTHON_USE_MODULE_STATE
@@ -2308,13 +2358,17 @@ static int __pyx_m_clear(PyObject *m) {
2308
2358
  Py_CLEAR(clear_module_state->__pyx_FusedFunctionType);
2309
2359
  #endif
2310
2360
  Py_CLEAR(clear_module_state->__pyx_kp_u_);
2361
+ Py_CLEAR(clear_module_state->__pyx_n_s_Optional);
2362
+ Py_CLEAR(clear_module_state->__pyx_kp_s_Optional_bytes);
2363
+ Py_CLEAR(clear_module_state->__pyx_kp_s_Optional_str);
2311
2364
  Py_CLEAR(clear_module_state->__pyx_kp_u_ULID_bytes_be_16_bytes);
2312
2365
  Py_CLEAR(clear_module_state->__pyx_kp_u_ULID_must_be_a_26_character_stri);
2313
2366
  Py_CLEAR(clear_module_state->__pyx_n_s_ValueError);
2314
- Py_CLEAR(clear_module_state->__pyx_n_s__9);
2367
+ Py_CLEAR(clear_module_state->__pyx_n_s__11);
2315
2368
  Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines);
2316
2369
  Py_CLEAR(clear_module_state->__pyx_n_s_bytes);
2317
2370
  Py_CLEAR(clear_module_state->__pyx_n_s_bytes_to_ulid);
2371
+ Py_CLEAR(clear_module_state->__pyx_n_s_bytes_to_ulid_or_none);
2318
2372
  Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback);
2319
2373
  Py_CLEAR(clear_module_state->__pyx_n_s_float);
2320
2374
  Py_CLEAR(clear_module_state->__pyx_n_s_import);
@@ -2327,11 +2381,13 @@ static int __pyx_m_clear(PyObject *m) {
2327
2381
  Py_CLEAR(clear_module_state->__pyx_n_s_test);
2328
2382
  Py_CLEAR(clear_module_state->__pyx_n_s_time);
2329
2383
  Py_CLEAR(clear_module_state->__pyx_n_s_time_2);
2384
+ Py_CLEAR(clear_module_state->__pyx_n_s_typing);
2330
2385
  Py_CLEAR(clear_module_state->__pyx_n_s_ulid_at_time);
2331
2386
  Py_CLEAR(clear_module_state->__pyx_n_s_ulid_bytes);
2332
2387
  Py_CLEAR(clear_module_state->__pyx_n_s_ulid_now);
2333
2388
  Py_CLEAR(clear_module_state->__pyx_n_s_ulid_str);
2334
2389
  Py_CLEAR(clear_module_state->__pyx_n_s_ulid_to_bytes);
2390
+ Py_CLEAR(clear_module_state->__pyx_n_s_ulid_to_bytes_or_none);
2335
2391
  Py_CLEAR(clear_module_state->__pyx_n_s_ulid_transform__ulid_impl);
2336
2392
  Py_CLEAR(clear_module_state->__pyx_tuple__3);
2337
2393
  Py_CLEAR(clear_module_state->__pyx_tuple__5);
@@ -2340,6 +2396,8 @@ static int __pyx_m_clear(PyObject *m) {
2340
2396
  Py_CLEAR(clear_module_state->__pyx_codeobj__4);
2341
2397
  Py_CLEAR(clear_module_state->__pyx_codeobj__6);
2342
2398
  Py_CLEAR(clear_module_state->__pyx_codeobj__8);
2399
+ Py_CLEAR(clear_module_state->__pyx_codeobj__9);
2400
+ Py_CLEAR(clear_module_state->__pyx_codeobj__10);
2343
2401
  return 0;
2344
2402
  }
2345
2403
  #endif
@@ -2361,13 +2419,17 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
2361
2419
  Py_VISIT(traverse_module_state->__pyx_FusedFunctionType);
2362
2420
  #endif
2363
2421
  Py_VISIT(traverse_module_state->__pyx_kp_u_);
2422
+ Py_VISIT(traverse_module_state->__pyx_n_s_Optional);
2423
+ Py_VISIT(traverse_module_state->__pyx_kp_s_Optional_bytes);
2424
+ Py_VISIT(traverse_module_state->__pyx_kp_s_Optional_str);
2364
2425
  Py_VISIT(traverse_module_state->__pyx_kp_u_ULID_bytes_be_16_bytes);
2365
2426
  Py_VISIT(traverse_module_state->__pyx_kp_u_ULID_must_be_a_26_character_stri);
2366
2427
  Py_VISIT(traverse_module_state->__pyx_n_s_ValueError);
2367
- Py_VISIT(traverse_module_state->__pyx_n_s__9);
2428
+ Py_VISIT(traverse_module_state->__pyx_n_s__11);
2368
2429
  Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines);
2369
2430
  Py_VISIT(traverse_module_state->__pyx_n_s_bytes);
2370
2431
  Py_VISIT(traverse_module_state->__pyx_n_s_bytes_to_ulid);
2432
+ Py_VISIT(traverse_module_state->__pyx_n_s_bytes_to_ulid_or_none);
2371
2433
  Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback);
2372
2434
  Py_VISIT(traverse_module_state->__pyx_n_s_float);
2373
2435
  Py_VISIT(traverse_module_state->__pyx_n_s_import);
@@ -2380,11 +2442,13 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
2380
2442
  Py_VISIT(traverse_module_state->__pyx_n_s_test);
2381
2443
  Py_VISIT(traverse_module_state->__pyx_n_s_time);
2382
2444
  Py_VISIT(traverse_module_state->__pyx_n_s_time_2);
2445
+ Py_VISIT(traverse_module_state->__pyx_n_s_typing);
2383
2446
  Py_VISIT(traverse_module_state->__pyx_n_s_ulid_at_time);
2384
2447
  Py_VISIT(traverse_module_state->__pyx_n_s_ulid_bytes);
2385
2448
  Py_VISIT(traverse_module_state->__pyx_n_s_ulid_now);
2386
2449
  Py_VISIT(traverse_module_state->__pyx_n_s_ulid_str);
2387
2450
  Py_VISIT(traverse_module_state->__pyx_n_s_ulid_to_bytes);
2451
+ Py_VISIT(traverse_module_state->__pyx_n_s_ulid_to_bytes_or_none);
2388
2452
  Py_VISIT(traverse_module_state->__pyx_n_s_ulid_transform__ulid_impl);
2389
2453
  Py_VISIT(traverse_module_state->__pyx_tuple__3);
2390
2454
  Py_VISIT(traverse_module_state->__pyx_tuple__5);
@@ -2393,6 +2457,8 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
2393
2457
  Py_VISIT(traverse_module_state->__pyx_codeobj__4);
2394
2458
  Py_VISIT(traverse_module_state->__pyx_codeobj__6);
2395
2459
  Py_VISIT(traverse_module_state->__pyx_codeobj__8);
2460
+ Py_VISIT(traverse_module_state->__pyx_codeobj__9);
2461
+ Py_VISIT(traverse_module_state->__pyx_codeobj__10);
2396
2462
  return 0;
2397
2463
  }
2398
2464
  #endif
@@ -2430,13 +2496,17 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
2430
2496
  #if CYTHON_USE_MODULE_STATE
2431
2497
  #endif
2432
2498
  #define __pyx_kp_u_ __pyx_mstate_global->__pyx_kp_u_
2499
+ #define __pyx_n_s_Optional __pyx_mstate_global->__pyx_n_s_Optional
2500
+ #define __pyx_kp_s_Optional_bytes __pyx_mstate_global->__pyx_kp_s_Optional_bytes
2501
+ #define __pyx_kp_s_Optional_str __pyx_mstate_global->__pyx_kp_s_Optional_str
2433
2502
  #define __pyx_kp_u_ULID_bytes_be_16_bytes __pyx_mstate_global->__pyx_kp_u_ULID_bytes_be_16_bytes
2434
2503
  #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
2504
  #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
2505
+ #define __pyx_n_s__11 __pyx_mstate_global->__pyx_n_s__11
2437
2506
  #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines
2438
2507
  #define __pyx_n_s_bytes __pyx_mstate_global->__pyx_n_s_bytes
2439
2508
  #define __pyx_n_s_bytes_to_ulid __pyx_mstate_global->__pyx_n_s_bytes_to_ulid
2509
+ #define __pyx_n_s_bytes_to_ulid_or_none __pyx_mstate_global->__pyx_n_s_bytes_to_ulid_or_none
2440
2510
  #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback
2441
2511
  #define __pyx_n_s_float __pyx_mstate_global->__pyx_n_s_float
2442
2512
  #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import
@@ -2449,11 +2519,13 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
2449
2519
  #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test
2450
2520
  #define __pyx_n_s_time __pyx_mstate_global->__pyx_n_s_time
2451
2521
  #define __pyx_n_s_time_2 __pyx_mstate_global->__pyx_n_s_time_2
2522
+ #define __pyx_n_s_typing __pyx_mstate_global->__pyx_n_s_typing
2452
2523
  #define __pyx_n_s_ulid_at_time __pyx_mstate_global->__pyx_n_s_ulid_at_time
2453
2524
  #define __pyx_n_s_ulid_bytes __pyx_mstate_global->__pyx_n_s_ulid_bytes
2454
2525
  #define __pyx_n_s_ulid_now __pyx_mstate_global->__pyx_n_s_ulid_now
2455
2526
  #define __pyx_n_s_ulid_str __pyx_mstate_global->__pyx_n_s_ulid_str
2456
2527
  #define __pyx_n_s_ulid_to_bytes __pyx_mstate_global->__pyx_n_s_ulid_to_bytes
2528
+ #define __pyx_n_s_ulid_to_bytes_or_none __pyx_mstate_global->__pyx_n_s_ulid_to_bytes_or_none
2457
2529
  #define __pyx_n_s_ulid_transform__ulid_impl __pyx_mstate_global->__pyx_n_s_ulid_transform__ulid_impl
2458
2530
  #define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3
2459
2531
  #define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5
@@ -2462,28 +2534,30 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
2462
2534
  #define __pyx_codeobj__4 __pyx_mstate_global->__pyx_codeobj__4
2463
2535
  #define __pyx_codeobj__6 __pyx_mstate_global->__pyx_codeobj__6
2464
2536
  #define __pyx_codeobj__8 __pyx_mstate_global->__pyx_codeobj__8
2537
+ #define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9
2538
+ #define __pyx_codeobj__10 __pyx_mstate_global->__pyx_codeobj__10
2465
2539
  /* #### Code section: module_code ### */
2466
2540
 
2467
2541
  /* "string.to_py":31
2468
2542
  *
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): # <<<<<<<<<<<<<<
2543
+ * @cname("__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string")
2544
+ * cdef inline object __pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string(const string& s): # <<<<<<<<<<<<<<
2471
2545
  * return __Pyx_PyObject_FromStringAndSize(s.data(), s.size())
2472
2546
  * cdef extern from *:
2473
2547
  */
2474
2548
 
2475
- static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_string(std::string const &__pyx_v_s) {
2549
+ static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string(std::string const &__pyx_v_s) {
2476
2550
  PyObject *__pyx_r = NULL;
2477
2551
  __Pyx_RefNannyDeclarations
2478
2552
  PyObject *__pyx_t_1 = NULL;
2479
2553
  int __pyx_lineno = 0;
2480
2554
  const char *__pyx_filename = NULL;
2481
2555
  int __pyx_clineno = 0;
2482
- __Pyx_RefNannySetupContext("__pyx_convert_PyObject_string_to_py_std__in_string", 1);
2556
+ __Pyx_RefNannySetupContext("__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string", 1);
2483
2557
 
2484
2558
  /* "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):
2559
+ * @cname("__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string")
2560
+ * cdef inline object __pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string(const string& s):
2487
2561
  * return __Pyx_PyObject_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
2488
2562
  * cdef extern from *:
2489
2563
  * cdef object __Pyx_PyUnicode_FromStringAndSize(const char*, size_t)
@@ -2497,8 +2571,8 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_strin
2497
2571
 
2498
2572
  /* "string.to_py":31
2499
2573
  *
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): # <<<<<<<<<<<<<<
2574
+ * @cname("__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string")
2575
+ * cdef inline object __pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string(const string& s): # <<<<<<<<<<<<<<
2502
2576
  * return __Pyx_PyObject_FromStringAndSize(s.data(), s.size())
2503
2577
  * cdef extern from *:
2504
2578
  */
@@ -2506,7 +2580,7 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_strin
2506
2580
  /* function exit code */
2507
2581
  __pyx_L1_error:;
2508
2582
  __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);
2583
+ __Pyx_AddTraceback("string.to_py.__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
2510
2584
  __pyx_r = 0;
2511
2585
  __pyx_L0:;
2512
2586
  __Pyx_XGIVEREF(__pyx_r);
@@ -2516,24 +2590,24 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_strin
2516
2590
 
2517
2591
  /* "string.to_py":37
2518
2592
  *
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): # <<<<<<<<<<<<<<
2593
+ * @cname("__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string")
2594
+ * cdef inline object __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(const string& s): # <<<<<<<<<<<<<<
2521
2595
  * return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size())
2522
2596
  * cdef extern from *:
2523
2597
  */
2524
2598
 
2525
- static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_string(std::string const &__pyx_v_s) {
2599
+ static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(std::string const &__pyx_v_s) {
2526
2600
  PyObject *__pyx_r = NULL;
2527
2601
  __Pyx_RefNannyDeclarations
2528
2602
  PyObject *__pyx_t_1 = NULL;
2529
2603
  int __pyx_lineno = 0;
2530
2604
  const char *__pyx_filename = NULL;
2531
2605
  int __pyx_clineno = 0;
2532
- __Pyx_RefNannySetupContext("__pyx_convert_PyUnicode_string_to_py_std__in_string", 1);
2606
+ __Pyx_RefNannySetupContext("__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string", 1);
2533
2607
 
2534
2608
  /* "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):
2609
+ * @cname("__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string")
2610
+ * cdef inline object __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(const string& s):
2537
2611
  * return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
2538
2612
  * cdef extern from *:
2539
2613
  * cdef object __Pyx_PyStr_FromStringAndSize(const char*, size_t)
@@ -2547,8 +2621,8 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_stri
2547
2621
 
2548
2622
  /* "string.to_py":37
2549
2623
  *
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): # <<<<<<<<<<<<<<
2624
+ * @cname("__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string")
2625
+ * cdef inline object __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(const string& s): # <<<<<<<<<<<<<<
2552
2626
  * return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size())
2553
2627
  * cdef extern from *:
2554
2628
  */
@@ -2556,7 +2630,7 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_stri
2556
2630
  /* function exit code */
2557
2631
  __pyx_L1_error:;
2558
2632
  __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);
2633
+ __Pyx_AddTraceback("string.to_py.__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
2560
2634
  __pyx_r = 0;
2561
2635
  __pyx_L0:;
2562
2636
  __Pyx_XGIVEREF(__pyx_r);
@@ -2566,24 +2640,24 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_stri
2566
2640
 
2567
2641
  /* "string.to_py":43
2568
2642
  *
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): # <<<<<<<<<<<<<<
2643
+ * @cname("__pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string")
2644
+ * cdef inline object __pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string(const string& s): # <<<<<<<<<<<<<<
2571
2645
  * return __Pyx_PyStr_FromStringAndSize(s.data(), s.size())
2572
2646
  * cdef extern from *:
2573
2647
  */
2574
2648
 
2575
- static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(std::string const &__pyx_v_s) {
2649
+ static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string(std::string const &__pyx_v_s) {
2576
2650
  PyObject *__pyx_r = NULL;
2577
2651
  __Pyx_RefNannyDeclarations
2578
2652
  PyObject *__pyx_t_1 = NULL;
2579
2653
  int __pyx_lineno = 0;
2580
2654
  const char *__pyx_filename = NULL;
2581
2655
  int __pyx_clineno = 0;
2582
- __Pyx_RefNannySetupContext("__pyx_convert_PyStr_string_to_py_std__in_string", 1);
2656
+ __Pyx_RefNannySetupContext("__pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string", 1);
2583
2657
 
2584
2658
  /* "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):
2659
+ * @cname("__pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string")
2660
+ * cdef inline object __pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string(const string& s):
2587
2661
  * return __Pyx_PyStr_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
2588
2662
  * cdef extern from *:
2589
2663
  * cdef object __Pyx_PyBytes_FromStringAndSize(const char*, size_t)
@@ -2597,8 +2671,8 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(s
2597
2671
 
2598
2672
  /* "string.to_py":43
2599
2673
  *
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): # <<<<<<<<<<<<<<
2674
+ * @cname("__pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string")
2675
+ * cdef inline object __pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string(const string& s): # <<<<<<<<<<<<<<
2602
2676
  * return __Pyx_PyStr_FromStringAndSize(s.data(), s.size())
2603
2677
  * cdef extern from *:
2604
2678
  */
@@ -2606,7 +2680,7 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(s
2606
2680
  /* function exit code */
2607
2681
  __pyx_L1_error:;
2608
2682
  __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);
2683
+ __Pyx_AddTraceback("string.to_py.__pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
2610
2684
  __pyx_r = 0;
2611
2685
  __pyx_L0:;
2612
2686
  __Pyx_XGIVEREF(__pyx_r);
@@ -2616,24 +2690,24 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(s
2616
2690
 
2617
2691
  /* "string.to_py":49
2618
2692
  *
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): # <<<<<<<<<<<<<<
2693
+ * @cname("__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string")
2694
+ * cdef inline object __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(const string& s): # <<<<<<<<<<<<<<
2621
2695
  * return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size())
2622
2696
  * cdef extern from *:
2623
2697
  */
2624
2698
 
2625
- static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string(std::string const &__pyx_v_s) {
2699
+ static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(std::string const &__pyx_v_s) {
2626
2700
  PyObject *__pyx_r = NULL;
2627
2701
  __Pyx_RefNannyDeclarations
2628
2702
  PyObject *__pyx_t_1 = NULL;
2629
2703
  int __pyx_lineno = 0;
2630
2704
  const char *__pyx_filename = NULL;
2631
2705
  int __pyx_clineno = 0;
2632
- __Pyx_RefNannySetupContext("__pyx_convert_PyBytes_string_to_py_std__in_string", 1);
2706
+ __Pyx_RefNannySetupContext("__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string", 1);
2633
2707
 
2634
2708
  /* "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):
2709
+ * @cname("__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string")
2710
+ * cdef inline object __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(const string& s):
2637
2711
  * return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
2638
2712
  * cdef extern from *:
2639
2713
  * cdef object __Pyx_PyByteArray_FromStringAndSize(const char*, size_t)
@@ -2647,8 +2721,8 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string
2647
2721
 
2648
2722
  /* "string.to_py":49
2649
2723
  *
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): # <<<<<<<<<<<<<<
2724
+ * @cname("__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string")
2725
+ * cdef inline object __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(const string& s): # <<<<<<<<<<<<<<
2652
2726
  * return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size())
2653
2727
  * cdef extern from *:
2654
2728
  */
@@ -2656,7 +2730,7 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string
2656
2730
  /* function exit code */
2657
2731
  __pyx_L1_error:;
2658
2732
  __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);
2733
+ __Pyx_AddTraceback("string.to_py.__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
2660
2734
  __pyx_r = 0;
2661
2735
  __pyx_L0:;
2662
2736
  __Pyx_XGIVEREF(__pyx_r);
@@ -2666,24 +2740,24 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string
2666
2740
 
2667
2741
  /* "string.to_py":55
2668
2742
  *
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): # <<<<<<<<<<<<<<
2743
+ * @cname("__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string")
2744
+ * cdef inline object __pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string(const string& s): # <<<<<<<<<<<<<<
2671
2745
  * return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size())
2672
2746
  *
2673
2747
  */
2674
2748
 
2675
- static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_string(std::string const &__pyx_v_s) {
2749
+ static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string(std::string const &__pyx_v_s) {
2676
2750
  PyObject *__pyx_r = NULL;
2677
2751
  __Pyx_RefNannyDeclarations
2678
2752
  PyObject *__pyx_t_1 = NULL;
2679
2753
  int __pyx_lineno = 0;
2680
2754
  const char *__pyx_filename = NULL;
2681
2755
  int __pyx_clineno = 0;
2682
- __Pyx_RefNannySetupContext("__pyx_convert_PyByteArray_string_to_py_std__in_string", 1);
2756
+ __Pyx_RefNannySetupContext("__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string", 1);
2683
2757
 
2684
2758
  /* "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):
2759
+ * @cname("__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string")
2760
+ * cdef inline object __pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string(const string& s):
2687
2761
  * return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
2688
2762
  *
2689
2763
  */
@@ -2696,8 +2770,8 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_st
2696
2770
 
2697
2771
  /* "string.to_py":55
2698
2772
  *
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): # <<<<<<<<<<<<<<
2773
+ * @cname("__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string")
2774
+ * cdef inline object __pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string(const string& s): # <<<<<<<<<<<<<<
2701
2775
  * return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size())
2702
2776
  *
2703
2777
  */
@@ -2705,7 +2779,7 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_st
2705
2779
  /* function exit code */
2706
2780
  __pyx_L1_error:;
2707
2781
  __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);
2782
+ __Pyx_AddTraceback("string.to_py.__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
2709
2783
  __pyx_r = 0;
2710
2784
  __pyx_L0:;
2711
2785
  __Pyx_XGIVEREF(__pyx_r);
@@ -2715,13 +2789,13 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_st
2715
2789
 
2716
2790
  /* "string.from_py":13
2717
2791
  *
2718
- * @cname("__pyx_convert_string_from_py_std__in_string")
2719
- * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: # <<<<<<<<<<<<<<
2792
+ * @cname("__pyx_convert_string_from_py_6libcpp_6string_std__in_string")
2793
+ * cdef string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(object o) except *: # <<<<<<<<<<<<<<
2720
2794
  * cdef Py_ssize_t length = 0
2721
2795
  * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
2722
2796
  */
2723
2797
 
2724
- static std::string __pyx_convert_string_from_py_std__in_string(PyObject *__pyx_v_o) {
2798
+ static std::string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(PyObject *__pyx_v_o) {
2725
2799
  Py_ssize_t __pyx_v_length;
2726
2800
  char const *__pyx_v_data;
2727
2801
  std::string __pyx_r;
@@ -2732,8 +2806,8 @@ static std::string __pyx_convert_string_from_py_std__in_string(PyObject *__pyx_v
2732
2806
  int __pyx_clineno = 0;
2733
2807
 
2734
2808
  /* "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 *:
2809
+ * @cname("__pyx_convert_string_from_py_6libcpp_6string_std__in_string")
2810
+ * cdef string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(object o) except *:
2737
2811
  * cdef Py_ssize_t length = 0 # <<<<<<<<<<<<<<
2738
2812
  * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
2739
2813
  * return string(data, length)
@@ -2741,7 +2815,7 @@ static std::string __pyx_convert_string_from_py_std__in_string(PyObject *__pyx_v
2741
2815
  __pyx_v_length = 0;
2742
2816
 
2743
2817
  /* "string.from_py":15
2744
- * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *:
2818
+ * cdef string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(object o) except *:
2745
2819
  * cdef Py_ssize_t length = 0
2746
2820
  * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) # <<<<<<<<<<<<<<
2747
2821
  * return string(data, length)
@@ -2768,21 +2842,21 @@ static std::string __pyx_convert_string_from_py_std__in_string(PyObject *__pyx_v
2768
2842
 
2769
2843
  /* "string.from_py":13
2770
2844
  *
2771
- * @cname("__pyx_convert_string_from_py_std__in_string")
2772
- * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: # <<<<<<<<<<<<<<
2845
+ * @cname("__pyx_convert_string_from_py_6libcpp_6string_std__in_string")
2846
+ * cdef string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(object o) except *: # <<<<<<<<<<<<<<
2773
2847
  * cdef Py_ssize_t length = 0
2774
2848
  * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
2775
2849
  */
2776
2850
 
2777
2851
  /* function exit code */
2778
2852
  __pyx_L1_error:;
2779
- __Pyx_AddTraceback("string.from_py.__pyx_convert_string_from_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
2853
+ __Pyx_AddTraceback("string.from_py.__pyx_convert_string_from_py_6libcpp_6string_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
2780
2854
  __Pyx_pretend_to_initialize(&__pyx_r);
2781
2855
  __pyx_L0:;
2782
2856
  return __pyx_r;
2783
2857
  }
2784
2858
 
2785
- /* "ulid_transform/_ulid_impl.pyx":16
2859
+ /* "ulid_transform/_ulid_impl.pyx":17
2786
2860
  *
2787
2861
  *
2788
2862
  * def _ulid_now() -> str: # <<<<<<<<<<<<<<
@@ -2815,7 +2889,7 @@ static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl__ulid_now(CYTHON_UNUSED
2815
2889
  int __pyx_clineno = 0;
2816
2890
  __Pyx_RefNannySetupContext("_ulid_now", 1);
2817
2891
 
2818
- /* "ulid_transform/_ulid_impl.pyx":17
2892
+ /* "ulid_transform/_ulid_impl.pyx":18
2819
2893
  *
2820
2894
  * def _ulid_now() -> str:
2821
2895
  * return _cpp_ulid().decode("ascii") # <<<<<<<<<<<<<<
@@ -2823,13 +2897,13 @@ static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl__ulid_now(CYTHON_UNUSED
2823
2897
  * def _ulid_at_time(_time: float) -> str:
2824
2898
  */
2825
2899
  __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)
2900
+ __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
2901
  __Pyx_GOTREF(__pyx_t_1);
2828
2902
  __pyx_r = ((PyObject*)__pyx_t_1);
2829
2903
  __pyx_t_1 = 0;
2830
2904
  goto __pyx_L0;
2831
2905
 
2832
- /* "ulid_transform/_ulid_impl.pyx":16
2906
+ /* "ulid_transform/_ulid_impl.pyx":17
2833
2907
  *
2834
2908
  *
2835
2909
  * def _ulid_now() -> str: # <<<<<<<<<<<<<<
@@ -2848,7 +2922,7 @@ static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl__ulid_now(CYTHON_UNUSED
2848
2922
  return __pyx_r;
2849
2923
  }
2850
2924
 
2851
- /* "ulid_transform/_ulid_impl.pyx":19
2925
+ /* "ulid_transform/_ulid_impl.pyx":20
2852
2926
  * return _cpp_ulid().decode("ascii")
2853
2927
  *
2854
2928
  * def _ulid_at_time(_time: float) -> str: # <<<<<<<<<<<<<<
@@ -2909,23 +2983,23 @@ PyObject *__pyx_args, PyObject *__pyx_kwds
2909
2983
  (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
2910
2984
  kw_args--;
2911
2985
  }
2912
- else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 19, __pyx_L3_error)
2986
+ else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 20, __pyx_L3_error)
2913
2987
  else goto __pyx_L5_argtuple_error;
2914
2988
  }
2915
2989
  if (unlikely(kw_args > 0)) {
2916
2990
  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)
2991
+ 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
2992
  }
2919
2993
  } else if (unlikely(__pyx_nargs != 1)) {
2920
2994
  goto __pyx_L5_argtuple_error;
2921
2995
  } else {
2922
2996
  values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
2923
2997
  }
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)
2998
+ __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
2999
  }
2926
3000
  goto __pyx_L6_skip;
2927
3001
  __pyx_L5_argtuple_error:;
2928
- __Pyx_RaiseArgtupleInvalid("_ulid_at_time", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 19, __pyx_L3_error)
3002
+ __Pyx_RaiseArgtupleInvalid("_ulid_at_time", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 20, __pyx_L3_error)
2929
3003
  __pyx_L6_skip:;
2930
3004
  goto __pyx_L4_argument_unpacking_done;
2931
3005
  __pyx_L3_error:;
@@ -2961,7 +3035,7 @@ static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl_2_ulid_at_time(CYTHON_UN
2961
3035
  int __pyx_clineno = 0;
2962
3036
  __Pyx_RefNannySetupContext("_ulid_at_time", 1);
2963
3037
 
2964
- /* "ulid_transform/_ulid_impl.pyx":20
3038
+ /* "ulid_transform/_ulid_impl.pyx":21
2965
3039
  *
2966
3040
  * def _ulid_at_time(_time: float) -> str:
2967
3041
  * return _cpp_ulid_at_time(_time).decode("ascii") # <<<<<<<<<<<<<<
@@ -2969,13 +3043,13 @@ static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl_2_ulid_at_time(CYTHON_UN
2969
3043
  * def _ulid_to_bytes(ulid_str: str) -> bytes:
2970
3044
  */
2971
3045
  __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)
3046
+ __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
3047
  __Pyx_GOTREF(__pyx_t_1);
2974
3048
  __pyx_r = ((PyObject*)__pyx_t_1);
2975
3049
  __pyx_t_1 = 0;
2976
3050
  goto __pyx_L0;
2977
3051
 
2978
- /* "ulid_transform/_ulid_impl.pyx":19
3052
+ /* "ulid_transform/_ulid_impl.pyx":20
2979
3053
  * return _cpp_ulid().decode("ascii")
2980
3054
  *
2981
3055
  * def _ulid_at_time(_time: float) -> str: # <<<<<<<<<<<<<<
@@ -2994,7 +3068,7 @@ static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl_2_ulid_at_time(CYTHON_UN
2994
3068
  return __pyx_r;
2995
3069
  }
2996
3070
 
2997
- /* "ulid_transform/_ulid_impl.pyx":22
3071
+ /* "ulid_transform/_ulid_impl.pyx":23
2998
3072
  * return _cpp_ulid_at_time(_time).decode("ascii")
2999
3073
  *
3000
3074
  * def _ulid_to_bytes(ulid_str: str) -> bytes: # <<<<<<<<<<<<<<
@@ -3055,12 +3129,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds
3055
3129
  (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
3056
3130
  kw_args--;
3057
3131
  }
3058
- else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 22, __pyx_L3_error)
3132
+ else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 23, __pyx_L3_error)
3059
3133
  else goto __pyx_L5_argtuple_error;
3060
3134
  }
3061
3135
  if (unlikely(kw_args > 0)) {
3062
3136
  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)
3137
+ 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
3138
  }
3065
3139
  } else if (unlikely(__pyx_nargs != 1)) {
3066
3140
  goto __pyx_L5_argtuple_error;
@@ -3071,7 +3145,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds
3071
3145
  }
3072
3146
  goto __pyx_L6_skip;
3073
3147
  __pyx_L5_argtuple_error:;
3074
- __Pyx_RaiseArgtupleInvalid("_ulid_to_bytes", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 22, __pyx_L3_error)
3148
+ __Pyx_RaiseArgtupleInvalid("_ulid_to_bytes", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 23, __pyx_L3_error)
3075
3149
  __pyx_L6_skip:;
3076
3150
  goto __pyx_L4_argument_unpacking_done;
3077
3151
  __pyx_L3_error:;
@@ -3085,7 +3159,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds
3085
3159
  __Pyx_RefNannyFinishContext();
3086
3160
  return NULL;
3087
3161
  __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)
3162
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ulid_str), (&PyUnicode_Type), 0, "ulid_str", 1))) __PYX_ERR(0, 23, __pyx_L1_error)
3089
3163
  __pyx_r = __pyx_pf_14ulid_transform_10_ulid_impl_4_ulid_to_bytes(__pyx_self, __pyx_v_ulid_str);
3090
3164
 
3091
3165
  /* function exit code */
@@ -3116,34 +3190,34 @@ static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl_4_ulid_to_bytes(CYTHON_U
3116
3190
  int __pyx_clineno = 0;
3117
3191
  __Pyx_RefNannySetupContext("_ulid_to_bytes", 1);
3118
3192
 
3119
- /* "ulid_transform/_ulid_impl.pyx":23
3193
+ /* "ulid_transform/_ulid_impl.pyx":24
3120
3194
  *
3121
3195
  * def _ulid_to_bytes(ulid_str: str) -> bytes:
3122
3196
  * if len(ulid_str) != 26: # <<<<<<<<<<<<<<
3123
3197
  * raise ValueError(f"ULID must be a 26 character string: {ulid_str}")
3124
3198
  * return _cpp_ulid_to_bytes(ulid_str.encode("ascii"))
3125
3199
  */
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)
3200
+ __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
3201
  __pyx_t_2 = (__pyx_t_1 != 26);
3128
3202
  if (unlikely(__pyx_t_2)) {
3129
3203
 
3130
- /* "ulid_transform/_ulid_impl.pyx":24
3204
+ /* "ulid_transform/_ulid_impl.pyx":25
3131
3205
  * def _ulid_to_bytes(ulid_str: str) -> bytes:
3132
3206
  * if len(ulid_str) != 26:
3133
3207
  * raise ValueError(f"ULID must be a 26 character string: {ulid_str}") # <<<<<<<<<<<<<<
3134
3208
  * return _cpp_ulid_to_bytes(ulid_str.encode("ascii"))
3135
3209
  *
3136
3210
  */
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)
3211
+ __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
3212
  __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)
3213
+ __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
3214
  __Pyx_GOTREF(__pyx_t_4);
3141
3215
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3142
3216
  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
3143
3217
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3144
- __PYX_ERR(0, 24, __pyx_L1_error)
3218
+ __PYX_ERR(0, 25, __pyx_L1_error)
3145
3219
 
3146
- /* "ulid_transform/_ulid_impl.pyx":23
3220
+ /* "ulid_transform/_ulid_impl.pyx":24
3147
3221
  *
3148
3222
  * def _ulid_to_bytes(ulid_str: str) -> bytes:
3149
3223
  * if len(ulid_str) != 26: # <<<<<<<<<<<<<<
@@ -3152,7 +3226,7 @@ static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl_4_ulid_to_bytes(CYTHON_U
3152
3226
  */
3153
3227
  }
3154
3228
 
3155
- /* "ulid_transform/_ulid_impl.pyx":25
3229
+ /* "ulid_transform/_ulid_impl.pyx":26
3156
3230
  * if len(ulid_str) != 26:
3157
3231
  * raise ValueError(f"ULID must be a 26 character string: {ulid_str}")
3158
3232
  * return _cpp_ulid_to_bytes(ulid_str.encode("ascii")) # <<<<<<<<<<<<<<
@@ -3160,17 +3234,17 @@ static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl_4_ulid_to_bytes(CYTHON_U
3160
3234
  * def _bytes_to_ulid(ulid_bytes: bytes) -> str:
3161
3235
  */
3162
3236
  __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)
3237
+ __pyx_t_4 = PyUnicode_AsASCIIString(__pyx_v_ulid_str); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 26, __pyx_L1_error)
3164
3238
  __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)
3239
+ __pyx_t_5 = __Pyx_PyBytes_AsString(__pyx_t_4); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 26, __pyx_L1_error)
3240
+ __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
3241
  __Pyx_GOTREF(__pyx_t_3);
3168
3242
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3169
3243
  __pyx_r = ((PyObject*)__pyx_t_3);
3170
3244
  __pyx_t_3 = 0;
3171
3245
  goto __pyx_L0;
3172
3246
 
3173
- /* "ulid_transform/_ulid_impl.pyx":22
3247
+ /* "ulid_transform/_ulid_impl.pyx":23
3174
3248
  * return _cpp_ulid_at_time(_time).decode("ascii")
3175
3249
  *
3176
3250
  * def _ulid_to_bytes(ulid_str: str) -> bytes: # <<<<<<<<<<<<<<
@@ -3190,7 +3264,7 @@ static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl_4_ulid_to_bytes(CYTHON_U
3190
3264
  return __pyx_r;
3191
3265
  }
3192
3266
 
3193
- /* "ulid_transform/_ulid_impl.pyx":27
3267
+ /* "ulid_transform/_ulid_impl.pyx":28
3194
3268
  * return _cpp_ulid_to_bytes(ulid_str.encode("ascii"))
3195
3269
  *
3196
3270
  * def _bytes_to_ulid(ulid_bytes: bytes) -> str: # <<<<<<<<<<<<<<
@@ -3251,12 +3325,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds
3251
3325
  (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
3252
3326
  kw_args--;
3253
3327
  }
3254
- else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 27, __pyx_L3_error)
3328
+ else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 28, __pyx_L3_error)
3255
3329
  else goto __pyx_L5_argtuple_error;
3256
3330
  }
3257
3331
  if (unlikely(kw_args > 0)) {
3258
3332
  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)
3333
+ 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
3334
  }
3261
3335
  } else if (unlikely(__pyx_nargs != 1)) {
3262
3336
  goto __pyx_L5_argtuple_error;
@@ -3267,7 +3341,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds
3267
3341
  }
3268
3342
  goto __pyx_L6_skip;
3269
3343
  __pyx_L5_argtuple_error:;
3270
- __Pyx_RaiseArgtupleInvalid("_bytes_to_ulid", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 27, __pyx_L3_error)
3344
+ __Pyx_RaiseArgtupleInvalid("_bytes_to_ulid", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 28, __pyx_L3_error)
3271
3345
  __pyx_L6_skip:;
3272
3346
  goto __pyx_L4_argument_unpacking_done;
3273
3347
  __pyx_L3_error:;
@@ -3281,7 +3355,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds
3281
3355
  __Pyx_RefNannyFinishContext();
3282
3356
  return NULL;
3283
3357
  __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)
3358
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ulid_bytes), (&PyBytes_Type), 0, "ulid_bytes", 1))) __PYX_ERR(0, 28, __pyx_L1_error)
3285
3359
  __pyx_r = __pyx_pf_14ulid_transform_10_ulid_impl_6_bytes_to_ulid(__pyx_self, __pyx_v_ulid_bytes);
3286
3360
 
3287
3361
  /* function exit code */
@@ -3312,36 +3386,37 @@ static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl_6_bytes_to_ulid(CYTHON_U
3312
3386
  int __pyx_clineno = 0;
3313
3387
  __Pyx_RefNannySetupContext("_bytes_to_ulid", 1);
3314
3388
 
3315
- /* "ulid_transform/_ulid_impl.pyx":28
3389
+ /* "ulid_transform/_ulid_impl.pyx":29
3316
3390
  *
3317
3391
  * def _bytes_to_ulid(ulid_bytes: bytes) -> str:
3318
3392
  * if len(ulid_bytes) != 16: # <<<<<<<<<<<<<<
3319
3393
  * raise ValueError(f"ULID bytes be 16 bytes: {ulid_bytes}")
3320
3394
  * return _cpp_bytes_to_ulid(ulid_bytes).decode("ascii")
3321
3395
  */
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)
3396
+ __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
3397
  __pyx_t_2 = (__pyx_t_1 != 16);
3324
3398
  if (unlikely(__pyx_t_2)) {
3325
3399
 
3326
- /* "ulid_transform/_ulid_impl.pyx":29
3400
+ /* "ulid_transform/_ulid_impl.pyx":30
3327
3401
  * def _bytes_to_ulid(ulid_bytes: bytes) -> str:
3328
3402
  * if len(ulid_bytes) != 16:
3329
3403
  * raise ValueError(f"ULID bytes be 16 bytes: {ulid_bytes}") # <<<<<<<<<<<<<<
3330
3404
  * return _cpp_bytes_to_ulid(ulid_bytes).decode("ascii")
3405
+ *
3331
3406
  */
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)
3407
+ __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_v_ulid_bytes, __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error)
3333
3408
  __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)
3409
+ __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, 30, __pyx_L1_error)
3335
3410
  __Pyx_GOTREF(__pyx_t_4);
3336
3411
  __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)
3412
+ __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
3413
  __Pyx_GOTREF(__pyx_t_3);
3339
3414
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3340
3415
  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
3341
3416
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3342
- __PYX_ERR(0, 29, __pyx_L1_error)
3417
+ __PYX_ERR(0, 30, __pyx_L1_error)
3343
3418
 
3344
- /* "ulid_transform/_ulid_impl.pyx":28
3419
+ /* "ulid_transform/_ulid_impl.pyx":29
3345
3420
  *
3346
3421
  * def _bytes_to_ulid(ulid_bytes: bytes) -> str:
3347
3422
  * if len(ulid_bytes) != 16: # <<<<<<<<<<<<<<
@@ -3350,20 +3425,22 @@ static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl_6_bytes_to_ulid(CYTHON_U
3350
3425
  */
3351
3426
  }
3352
3427
 
3353
- /* "ulid_transform/_ulid_impl.pyx":30
3428
+ /* "ulid_transform/_ulid_impl.pyx":31
3354
3429
  * if len(ulid_bytes) != 16:
3355
3430
  * raise ValueError(f"ULID bytes be 16 bytes: {ulid_bytes}")
3356
3431
  * return _cpp_bytes_to_ulid(ulid_bytes).decode("ascii") # <<<<<<<<<<<<<<
3432
+ *
3433
+ * def _ulid_to_bytes_or_none(ulid_str: Optional[str]) -> Optional[bytes]:
3357
3434
  */
3358
3435
  __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)
3436
+ __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)
3437
+ __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
3438
  __Pyx_GOTREF(__pyx_t_3);
3362
3439
  __pyx_r = ((PyObject*)__pyx_t_3);
3363
3440
  __pyx_t_3 = 0;
3364
3441
  goto __pyx_L0;
3365
3442
 
3366
- /* "ulid_transform/_ulid_impl.pyx":27
3443
+ /* "ulid_transform/_ulid_impl.pyx":28
3367
3444
  * return _cpp_ulid_to_bytes(ulid_str.encode("ascii"))
3368
3445
  *
3369
3446
  * def _bytes_to_ulid(ulid_bytes: bytes) -> str: # <<<<<<<<<<<<<<
@@ -3383,6 +3460,410 @@ static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl_6_bytes_to_ulid(CYTHON_U
3383
3460
  return __pyx_r;
3384
3461
  }
3385
3462
 
3463
+ /* "ulid_transform/_ulid_impl.pyx":33
3464
+ * return _cpp_bytes_to_ulid(ulid_bytes).decode("ascii")
3465
+ *
3466
+ * def _ulid_to_bytes_or_none(ulid_str: Optional[str]) -> Optional[bytes]: # <<<<<<<<<<<<<<
3467
+ * if ulid_str is None or len(ulid_str) != 26:
3468
+ * return None
3469
+ */
3470
+
3471
+ /* Python wrapper */
3472
+ static PyObject *__pyx_pw_14ulid_transform_10_ulid_impl_9_ulid_to_bytes_or_none(PyObject *__pyx_self,
3473
+ #if CYTHON_METH_FASTCALL
3474
+ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
3475
+ #else
3476
+ PyObject *__pyx_args, PyObject *__pyx_kwds
3477
+ #endif
3478
+ ); /*proto*/
3479
+ 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};
3480
+ static PyObject *__pyx_pw_14ulid_transform_10_ulid_impl_9_ulid_to_bytes_or_none(PyObject *__pyx_self,
3481
+ #if CYTHON_METH_FASTCALL
3482
+ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
3483
+ #else
3484
+ PyObject *__pyx_args, PyObject *__pyx_kwds
3485
+ #endif
3486
+ ) {
3487
+ PyObject *__pyx_v_ulid_str = 0;
3488
+ #if !CYTHON_METH_FASTCALL
3489
+ CYTHON_UNUSED Py_ssize_t __pyx_nargs;
3490
+ #endif
3491
+ CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
3492
+ PyObject* values[1] = {0};
3493
+ int __pyx_lineno = 0;
3494
+ const char *__pyx_filename = NULL;
3495
+ int __pyx_clineno = 0;
3496
+ PyObject *__pyx_r = 0;
3497
+ __Pyx_RefNannyDeclarations
3498
+ __Pyx_RefNannySetupContext("_ulid_to_bytes_or_none (wrapper)", 0);
3499
+ #if !CYTHON_METH_FASTCALL
3500
+ #if CYTHON_ASSUME_SAFE_MACROS
3501
+ __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
3502
+ #else
3503
+ __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
3504
+ #endif
3505
+ #endif
3506
+ __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
3507
+ {
3508
+ PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ulid_str,0};
3509
+ if (__pyx_kwds) {
3510
+ Py_ssize_t kw_args;
3511
+ switch (__pyx_nargs) {
3512
+ case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
3513
+ CYTHON_FALLTHROUGH;
3514
+ case 0: break;
3515
+ default: goto __pyx_L5_argtuple_error;
3516
+ }
3517
+ kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
3518
+ switch (__pyx_nargs) {
3519
+ case 0:
3520
+ if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ulid_str)) != 0)) {
3521
+ (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
3522
+ kw_args--;
3523
+ }
3524
+ else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 33, __pyx_L3_error)
3525
+ else goto __pyx_L5_argtuple_error;
3526
+ }
3527
+ if (unlikely(kw_args > 0)) {
3528
+ const Py_ssize_t kwd_pos_args = __pyx_nargs;
3529
+ 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)
3530
+ }
3531
+ } else if (unlikely(__pyx_nargs != 1)) {
3532
+ goto __pyx_L5_argtuple_error;
3533
+ } else {
3534
+ values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
3535
+ }
3536
+ __pyx_v_ulid_str = ((PyObject*)values[0]);
3537
+ }
3538
+ goto __pyx_L6_skip;
3539
+ __pyx_L5_argtuple_error:;
3540
+ __Pyx_RaiseArgtupleInvalid("_ulid_to_bytes_or_none", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 33, __pyx_L3_error)
3541
+ __pyx_L6_skip:;
3542
+ goto __pyx_L4_argument_unpacking_done;
3543
+ __pyx_L3_error:;
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_AddTraceback("ulid_transform._ulid_impl._ulid_to_bytes_or_none", __pyx_clineno, __pyx_lineno, __pyx_filename);
3551
+ __Pyx_RefNannyFinishContext();
3552
+ return NULL;
3553
+ __pyx_L4_argument_unpacking_done:;
3554
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ulid_str), (&PyUnicode_Type), 1, "ulid_str", 1))) __PYX_ERR(0, 33, __pyx_L1_error)
3555
+ __pyx_r = __pyx_pf_14ulid_transform_10_ulid_impl_8_ulid_to_bytes_or_none(__pyx_self, __pyx_v_ulid_str);
3556
+
3557
+ /* function exit code */
3558
+ goto __pyx_L0;
3559
+ __pyx_L1_error:;
3560
+ __pyx_r = NULL;
3561
+ __pyx_L0:;
3562
+ {
3563
+ Py_ssize_t __pyx_temp;
3564
+ for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
3565
+ __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
3566
+ }
3567
+ }
3568
+ __Pyx_RefNannyFinishContext();
3569
+ return __pyx_r;
3570
+ }
3571
+
3572
+ 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) {
3573
+ PyObject *__pyx_r = NULL;
3574
+ __Pyx_RefNannyDeclarations
3575
+ int __pyx_t_1;
3576
+ int __pyx_t_2;
3577
+ Py_ssize_t __pyx_t_3;
3578
+ PyObject *__pyx_t_4 = NULL;
3579
+ char const *__pyx_t_5;
3580
+ PyObject *__pyx_t_6 = NULL;
3581
+ int __pyx_lineno = 0;
3582
+ const char *__pyx_filename = NULL;
3583
+ int __pyx_clineno = 0;
3584
+ __Pyx_RefNannySetupContext("_ulid_to_bytes_or_none", 1);
3585
+
3586
+ /* "ulid_transform/_ulid_impl.pyx":34
3587
+ *
3588
+ * def _ulid_to_bytes_or_none(ulid_str: Optional[str]) -> Optional[bytes]:
3589
+ * if ulid_str is None or len(ulid_str) != 26: # <<<<<<<<<<<<<<
3590
+ * return None
3591
+ * return _cpp_ulid_to_bytes(ulid_str.encode("ascii"))
3592
+ */
3593
+ __pyx_t_2 = (__pyx_v_ulid_str == ((PyObject*)Py_None));
3594
+ if (!__pyx_t_2) {
3595
+ } else {
3596
+ __pyx_t_1 = __pyx_t_2;
3597
+ goto __pyx_L4_bool_binop_done;
3598
+ }
3599
+ if (unlikely(__pyx_v_ulid_str == Py_None)) {
3600
+ PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
3601
+ __PYX_ERR(0, 34, __pyx_L1_error)
3602
+ }
3603
+ __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)
3604
+ __pyx_t_2 = (__pyx_t_3 != 26);
3605
+ __pyx_t_1 = __pyx_t_2;
3606
+ __pyx_L4_bool_binop_done:;
3607
+ if (__pyx_t_1) {
3608
+
3609
+ /* "ulid_transform/_ulid_impl.pyx":35
3610
+ * def _ulid_to_bytes_or_none(ulid_str: Optional[str]) -> Optional[bytes]:
3611
+ * if ulid_str is None or len(ulid_str) != 26:
3612
+ * return None # <<<<<<<<<<<<<<
3613
+ * return _cpp_ulid_to_bytes(ulid_str.encode("ascii"))
3614
+ *
3615
+ */
3616
+ __Pyx_XDECREF(__pyx_r);
3617
+ __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
3618
+ goto __pyx_L0;
3619
+
3620
+ /* "ulid_transform/_ulid_impl.pyx":34
3621
+ *
3622
+ * def _ulid_to_bytes_or_none(ulid_str: Optional[str]) -> Optional[bytes]:
3623
+ * if ulid_str is None or len(ulid_str) != 26: # <<<<<<<<<<<<<<
3624
+ * return None
3625
+ * return _cpp_ulid_to_bytes(ulid_str.encode("ascii"))
3626
+ */
3627
+ }
3628
+
3629
+ /* "ulid_transform/_ulid_impl.pyx":36
3630
+ * if ulid_str is None or len(ulid_str) != 26:
3631
+ * return None
3632
+ * return _cpp_ulid_to_bytes(ulid_str.encode("ascii")) # <<<<<<<<<<<<<<
3633
+ *
3634
+ * def _bytes_to_ulid_or_none(ulid_bytes: Optional[bytes]) -> Optional[str]:
3635
+ */
3636
+ __Pyx_XDECREF(__pyx_r);
3637
+ if (unlikely(__pyx_v_ulid_str == Py_None)) {
3638
+ PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode");
3639
+ __PYX_ERR(0, 36, __pyx_L1_error)
3640
+ }
3641
+ __pyx_t_4 = PyUnicode_AsASCIIString(__pyx_v_ulid_str); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 36, __pyx_L1_error)
3642
+ __Pyx_GOTREF(__pyx_t_4);
3643
+ __pyx_t_5 = __Pyx_PyBytes_AsString(__pyx_t_4); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 36, __pyx_L1_error)
3644
+ __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)
3645
+ __Pyx_GOTREF(__pyx_t_6);
3646
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3647
+ __pyx_r = ((PyObject*)__pyx_t_6);
3648
+ __pyx_t_6 = 0;
3649
+ goto __pyx_L0;
3650
+
3651
+ /* "ulid_transform/_ulid_impl.pyx":33
3652
+ * return _cpp_bytes_to_ulid(ulid_bytes).decode("ascii")
3653
+ *
3654
+ * def _ulid_to_bytes_or_none(ulid_str: Optional[str]) -> Optional[bytes]: # <<<<<<<<<<<<<<
3655
+ * if ulid_str is None or len(ulid_str) != 26:
3656
+ * return None
3657
+ */
3658
+
3659
+ /* function exit code */
3660
+ __pyx_L1_error:;
3661
+ __Pyx_XDECREF(__pyx_t_4);
3662
+ __Pyx_XDECREF(__pyx_t_6);
3663
+ __Pyx_AddTraceback("ulid_transform._ulid_impl._ulid_to_bytes_or_none", __pyx_clineno, __pyx_lineno, __pyx_filename);
3664
+ __pyx_r = NULL;
3665
+ __pyx_L0:;
3666
+ __Pyx_XGIVEREF(__pyx_r);
3667
+ __Pyx_RefNannyFinishContext();
3668
+ return __pyx_r;
3669
+ }
3670
+
3671
+ /* "ulid_transform/_ulid_impl.pyx":38
3672
+ * return _cpp_ulid_to_bytes(ulid_str.encode("ascii"))
3673
+ *
3674
+ * def _bytes_to_ulid_or_none(ulid_bytes: Optional[bytes]) -> Optional[str]: # <<<<<<<<<<<<<<
3675
+ * if ulid_bytes is None or len(ulid_bytes) != 16:
3676
+ * return None
3677
+ */
3678
+
3679
+ /* Python wrapper */
3680
+ static PyObject *__pyx_pw_14ulid_transform_10_ulid_impl_11_bytes_to_ulid_or_none(PyObject *__pyx_self,
3681
+ #if CYTHON_METH_FASTCALL
3682
+ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
3683
+ #else
3684
+ PyObject *__pyx_args, PyObject *__pyx_kwds
3685
+ #endif
3686
+ ); /*proto*/
3687
+ 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};
3688
+ static PyObject *__pyx_pw_14ulid_transform_10_ulid_impl_11_bytes_to_ulid_or_none(PyObject *__pyx_self,
3689
+ #if CYTHON_METH_FASTCALL
3690
+ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
3691
+ #else
3692
+ PyObject *__pyx_args, PyObject *__pyx_kwds
3693
+ #endif
3694
+ ) {
3695
+ PyObject *__pyx_v_ulid_bytes = 0;
3696
+ #if !CYTHON_METH_FASTCALL
3697
+ CYTHON_UNUSED Py_ssize_t __pyx_nargs;
3698
+ #endif
3699
+ CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
3700
+ PyObject* values[1] = {0};
3701
+ int __pyx_lineno = 0;
3702
+ const char *__pyx_filename = NULL;
3703
+ int __pyx_clineno = 0;
3704
+ PyObject *__pyx_r = 0;
3705
+ __Pyx_RefNannyDeclarations
3706
+ __Pyx_RefNannySetupContext("_bytes_to_ulid_or_none (wrapper)", 0);
3707
+ #if !CYTHON_METH_FASTCALL
3708
+ #if CYTHON_ASSUME_SAFE_MACROS
3709
+ __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
3710
+ #else
3711
+ __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
3712
+ #endif
3713
+ #endif
3714
+ __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
3715
+ {
3716
+ PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ulid_bytes,0};
3717
+ if (__pyx_kwds) {
3718
+ Py_ssize_t kw_args;
3719
+ switch (__pyx_nargs) {
3720
+ case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
3721
+ CYTHON_FALLTHROUGH;
3722
+ case 0: break;
3723
+ default: goto __pyx_L5_argtuple_error;
3724
+ }
3725
+ kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
3726
+ switch (__pyx_nargs) {
3727
+ case 0:
3728
+ if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ulid_bytes)) != 0)) {
3729
+ (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
3730
+ kw_args--;
3731
+ }
3732
+ else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 38, __pyx_L3_error)
3733
+ else goto __pyx_L5_argtuple_error;
3734
+ }
3735
+ if (unlikely(kw_args > 0)) {
3736
+ const Py_ssize_t kwd_pos_args = __pyx_nargs;
3737
+ 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)
3738
+ }
3739
+ } else if (unlikely(__pyx_nargs != 1)) {
3740
+ goto __pyx_L5_argtuple_error;
3741
+ } else {
3742
+ values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
3743
+ }
3744
+ __pyx_v_ulid_bytes = ((PyObject*)values[0]);
3745
+ }
3746
+ goto __pyx_L6_skip;
3747
+ __pyx_L5_argtuple_error:;
3748
+ __Pyx_RaiseArgtupleInvalid("_bytes_to_ulid_or_none", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 38, __pyx_L3_error)
3749
+ __pyx_L6_skip:;
3750
+ goto __pyx_L4_argument_unpacking_done;
3751
+ __pyx_L3_error:;
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_AddTraceback("ulid_transform._ulid_impl._bytes_to_ulid_or_none", __pyx_clineno, __pyx_lineno, __pyx_filename);
3759
+ __Pyx_RefNannyFinishContext();
3760
+ return NULL;
3761
+ __pyx_L4_argument_unpacking_done:;
3762
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ulid_bytes), (&PyBytes_Type), 1, "ulid_bytes", 1))) __PYX_ERR(0, 38, __pyx_L1_error)
3763
+ __pyx_r = __pyx_pf_14ulid_transform_10_ulid_impl_10_bytes_to_ulid_or_none(__pyx_self, __pyx_v_ulid_bytes);
3764
+
3765
+ /* function exit code */
3766
+ goto __pyx_L0;
3767
+ __pyx_L1_error:;
3768
+ __pyx_r = NULL;
3769
+ __pyx_L0:;
3770
+ {
3771
+ Py_ssize_t __pyx_temp;
3772
+ for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
3773
+ __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
3774
+ }
3775
+ }
3776
+ __Pyx_RefNannyFinishContext();
3777
+ return __pyx_r;
3778
+ }
3779
+
3780
+ 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) {
3781
+ PyObject *__pyx_r = NULL;
3782
+ __Pyx_RefNannyDeclarations
3783
+ int __pyx_t_1;
3784
+ int __pyx_t_2;
3785
+ Py_ssize_t __pyx_t_3;
3786
+ std::string __pyx_t_4;
3787
+ PyObject *__pyx_t_5 = NULL;
3788
+ int __pyx_lineno = 0;
3789
+ const char *__pyx_filename = NULL;
3790
+ int __pyx_clineno = 0;
3791
+ __Pyx_RefNannySetupContext("_bytes_to_ulid_or_none", 1);
3792
+
3793
+ /* "ulid_transform/_ulid_impl.pyx":39
3794
+ *
3795
+ * def _bytes_to_ulid_or_none(ulid_bytes: Optional[bytes]) -> Optional[str]:
3796
+ * if ulid_bytes is None or len(ulid_bytes) != 16: # <<<<<<<<<<<<<<
3797
+ * return None
3798
+ * return _cpp_bytes_to_ulid(ulid_bytes).decode("ascii")
3799
+ */
3800
+ __pyx_t_2 = (__pyx_v_ulid_bytes == ((PyObject*)Py_None));
3801
+ if (!__pyx_t_2) {
3802
+ } else {
3803
+ __pyx_t_1 = __pyx_t_2;
3804
+ goto __pyx_L4_bool_binop_done;
3805
+ }
3806
+ if (unlikely(__pyx_v_ulid_bytes == Py_None)) {
3807
+ PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
3808
+ __PYX_ERR(0, 39, __pyx_L1_error)
3809
+ }
3810
+ __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)
3811
+ __pyx_t_2 = (__pyx_t_3 != 16);
3812
+ __pyx_t_1 = __pyx_t_2;
3813
+ __pyx_L4_bool_binop_done:;
3814
+ if (__pyx_t_1) {
3815
+
3816
+ /* "ulid_transform/_ulid_impl.pyx":40
3817
+ * def _bytes_to_ulid_or_none(ulid_bytes: Optional[bytes]) -> Optional[str]:
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_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
3824
+ goto __pyx_L0;
3825
+
3826
+ /* "ulid_transform/_ulid_impl.pyx":39
3827
+ *
3828
+ * def _bytes_to_ulid_or_none(ulid_bytes: Optional[bytes]) -> Optional[str]:
3829
+ * if ulid_bytes is None or len(ulid_bytes) != 16: # <<<<<<<<<<<<<<
3830
+ * return None
3831
+ * return _cpp_bytes_to_ulid(ulid_bytes).decode("ascii")
3832
+ */
3833
+ }
3834
+
3835
+ /* "ulid_transform/_ulid_impl.pyx":41
3836
+ * if ulid_bytes is None or len(ulid_bytes) != 16:
3837
+ * return None
3838
+ * return _cpp_bytes_to_ulid(ulid_bytes).decode("ascii") # <<<<<<<<<<<<<<
3839
+ */
3840
+ __Pyx_XDECREF(__pyx_r);
3841
+ __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)
3842
+ __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)
3843
+ __Pyx_GOTREF(__pyx_t_5);
3844
+ __pyx_r = ((PyObject*)__pyx_t_5);
3845
+ __pyx_t_5 = 0;
3846
+ goto __pyx_L0;
3847
+
3848
+ /* "ulid_transform/_ulid_impl.pyx":38
3849
+ * return _cpp_ulid_to_bytes(ulid_str.encode("ascii"))
3850
+ *
3851
+ * def _bytes_to_ulid_or_none(ulid_bytes: Optional[bytes]) -> Optional[str]: # <<<<<<<<<<<<<<
3852
+ * if ulid_bytes is None or len(ulid_bytes) != 16:
3853
+ * return None
3854
+ */
3855
+
3856
+ /* function exit code */
3857
+ __pyx_L1_error:;
3858
+ __Pyx_XDECREF(__pyx_t_5);
3859
+ __Pyx_AddTraceback("ulid_transform._ulid_impl._bytes_to_ulid_or_none", __pyx_clineno, __pyx_lineno, __pyx_filename);
3860
+ __pyx_r = NULL;
3861
+ __pyx_L0:;
3862
+ __Pyx_XGIVEREF(__pyx_r);
3863
+ __Pyx_RefNannyFinishContext();
3864
+ return __pyx_r;
3865
+ }
3866
+
3386
3867
  static PyMethodDef __pyx_methods[] = {
3387
3868
  {0, 0, 0, 0}
3388
3869
  };
@@ -3400,13 +3881,17 @@ static PyMethodDef __pyx_methods[] = {
3400
3881
  static int __Pyx_CreateStringTabAndInitStrings(void) {
3401
3882
  __Pyx_StringTabEntry __pyx_string_tab[] = {
3402
3883
  {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0},
3884
+ {&__pyx_n_s_Optional, __pyx_k_Optional, sizeof(__pyx_k_Optional), 0, 0, 1, 1},
3885
+ {&__pyx_kp_s_Optional_bytes, __pyx_k_Optional_bytes, sizeof(__pyx_k_Optional_bytes), 0, 0, 1, 0},
3886
+ {&__pyx_kp_s_Optional_str, __pyx_k_Optional_str, sizeof(__pyx_k_Optional_str), 0, 0, 1, 0},
3403
3887
  {&__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},
3404
3888
  {&__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
3889
  {&__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},
3890
+ {&__pyx_n_s__11, __pyx_k__11, sizeof(__pyx_k__11), 0, 0, 1, 1},
3407
3891
  {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1},
3408
3892
  {&__pyx_n_s_bytes, __pyx_k_bytes, sizeof(__pyx_k_bytes), 0, 0, 1, 1},
3409
3893
  {&__pyx_n_s_bytes_to_ulid, __pyx_k_bytes_to_ulid, sizeof(__pyx_k_bytes_to_ulid), 0, 0, 1, 1},
3894
+ {&__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
3895
  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
3411
3896
  {&__pyx_n_s_float, __pyx_k_float, sizeof(__pyx_k_float), 0, 0, 1, 1},
3412
3897
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
@@ -3419,11 +3904,13 @@ static int __Pyx_CreateStringTabAndInitStrings(void) {
3419
3904
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
3420
3905
  {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1},
3421
3906
  {&__pyx_n_s_time_2, __pyx_k_time_2, sizeof(__pyx_k_time_2), 0, 0, 1, 1},
3907
+ {&__pyx_n_s_typing, __pyx_k_typing, sizeof(__pyx_k_typing), 0, 0, 1, 1},
3422
3908
  {&__pyx_n_s_ulid_at_time, __pyx_k_ulid_at_time, sizeof(__pyx_k_ulid_at_time), 0, 0, 1, 1},
3423
3909
  {&__pyx_n_s_ulid_bytes, __pyx_k_ulid_bytes, sizeof(__pyx_k_ulid_bytes), 0, 0, 1, 1},
3424
3910
  {&__pyx_n_s_ulid_now, __pyx_k_ulid_now, sizeof(__pyx_k_ulid_now), 0, 0, 1, 1},
3425
3911
  {&__pyx_n_s_ulid_str, __pyx_k_ulid_str, sizeof(__pyx_k_ulid_str), 0, 0, 1, 1},
3426
3912
  {&__pyx_n_s_ulid_to_bytes, __pyx_k_ulid_to_bytes, sizeof(__pyx_k_ulid_to_bytes), 0, 0, 1, 1},
3913
+ {&__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
3914
  {&__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
3915
  {0, 0, 0, 0, 0, 0, 0}
3429
3916
  };
@@ -3431,7 +3918,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) {
3431
3918
  }
3432
3919
  /* #### Code section: cached_builtins ### */
3433
3920
  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)
3921
+ __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 25, __pyx_L1_error)
3435
3922
  return 0;
3436
3923
  __pyx_L1_error:;
3437
3924
  return -1;
@@ -3442,50 +3929,68 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
3442
3929
  __Pyx_RefNannyDeclarations
3443
3930
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
3444
3931
 
3445
- /* "ulid_transform/_ulid_impl.pyx":16
3932
+ /* "ulid_transform/_ulid_impl.pyx":17
3446
3933
  *
3447
3934
  *
3448
3935
  * def _ulid_now() -> str: # <<<<<<<<<<<<<<
3449
3936
  * return _cpp_ulid().decode("ascii")
3450
3937
  *
3451
3938
  */
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)
3939
+ __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
3940
 
3454
- /* "ulid_transform/_ulid_impl.pyx":19
3941
+ /* "ulid_transform/_ulid_impl.pyx":20
3455
3942
  * return _cpp_ulid().decode("ascii")
3456
3943
  *
3457
3944
  * def _ulid_at_time(_time: float) -> str: # <<<<<<<<<<<<<<
3458
3945
  * return _cpp_ulid_at_time(_time).decode("ascii")
3459
3946
  *
3460
3947
  */
3461
- __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_time); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 19, __pyx_L1_error)
3948
+ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_time); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 20, __pyx_L1_error)
3462
3949
  __Pyx_GOTREF(__pyx_tuple__3);
3463
3950
  __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)
3951
+ __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
3952
 
3466
- /* "ulid_transform/_ulid_impl.pyx":22
3953
+ /* "ulid_transform/_ulid_impl.pyx":23
3467
3954
  * return _cpp_ulid_at_time(_time).decode("ascii")
3468
3955
  *
3469
3956
  * def _ulid_to_bytes(ulid_str: str) -> bytes: # <<<<<<<<<<<<<<
3470
3957
  * if len(ulid_str) != 26:
3471
3958
  * raise ValueError(f"ULID must be a 26 character string: {ulid_str}")
3472
3959
  */
3473
- __pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_ulid_str); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 22, __pyx_L1_error)
3960
+ __pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_ulid_str); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 23, __pyx_L1_error)
3474
3961
  __Pyx_GOTREF(__pyx_tuple__5);
3475
3962
  __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)
3963
+ __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
3964
 
3478
- /* "ulid_transform/_ulid_impl.pyx":27
3965
+ /* "ulid_transform/_ulid_impl.pyx":28
3479
3966
  * return _cpp_ulid_to_bytes(ulid_str.encode("ascii"))
3480
3967
  *
3481
3968
  * def _bytes_to_ulid(ulid_bytes: bytes) -> str: # <<<<<<<<<<<<<<
3482
3969
  * if len(ulid_bytes) != 16:
3483
3970
  * raise ValueError(f"ULID bytes be 16 bytes: {ulid_bytes}")
3484
3971
  */
3485
- __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_ulid_bytes); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 27, __pyx_L1_error)
3972
+ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_ulid_bytes); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 28, __pyx_L1_error)
3486
3973
  __Pyx_GOTREF(__pyx_tuple__7);
3487
3974
  __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)
3975
+ __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)
3976
+
3977
+ /* "ulid_transform/_ulid_impl.pyx":33
3978
+ * return _cpp_bytes_to_ulid(ulid_bytes).decode("ascii")
3979
+ *
3980
+ * def _ulid_to_bytes_or_none(ulid_str: Optional[str]) -> Optional[bytes]: # <<<<<<<<<<<<<<
3981
+ * if ulid_str is None or len(ulid_str) != 26:
3982
+ * return None
3983
+ */
3984
+ __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)
3985
+
3986
+ /* "ulid_transform/_ulid_impl.pyx":38
3987
+ * return _cpp_ulid_to_bytes(ulid_str.encode("ascii"))
3988
+ *
3989
+ * def _bytes_to_ulid_or_none(ulid_bytes: Optional[bytes]) -> Optional[str]: # <<<<<<<<<<<<<<
3990
+ * if ulid_bytes is None or len(ulid_bytes) != 16:
3991
+ * return None
3992
+ */
3993
+ __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
3994
  __Pyx_RefNannyFinishContext();
3490
3995
  return 0;
3491
3996
  __pyx_L1_error:;
@@ -3760,7 +4265,7 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec__ulid_impl(PyObject *__pyx_pyinit_
3760
4265
  __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
3761
4266
  {
3762
4267
  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 */
4268
+ __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "_ulid_impl" pseudovariable */
3764
4269
  if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
3765
4270
  pystate_addmodule_run = 1;
3766
4271
  }
@@ -3772,10 +4277,8 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec__ulid_impl(PyObject *__pyx_pyinit_
3772
4277
  CYTHON_UNUSED_VAR(__pyx_t_1);
3773
4278
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
3774
4279
  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);
4280
+ __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
4281
+ __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
3779
4282
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3780
4283
  #if CYTHON_REFNANNY
3781
4284
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
@@ -3856,8 +4359,8 @@ if (!__Pyx_RefNanny) {
3856
4359
  * from libcpp.string cimport string
3857
4360
  *
3858
4361
  * from time import time # <<<<<<<<<<<<<<
4362
+ * from typing import Optional
3859
4363
  *
3860
- * import cython
3861
4364
  */
3862
4365
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error)
3863
4366
  __Pyx_GOTREF(__pyx_t_2);
@@ -3873,86 +4376,143 @@ if (!__Pyx_RefNanny) {
3873
4376
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3874
4377
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3875
4378
 
3876
- /* "ulid_transform/_ulid_impl.pyx":16
4379
+ /* "ulid_transform/_ulid_impl.pyx":5
4380
+ *
4381
+ * from time import time
4382
+ * from typing import Optional # <<<<<<<<<<<<<<
4383
+ *
4384
+ * import cython
4385
+ */
4386
+ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error)
4387
+ __Pyx_GOTREF(__pyx_t_3);
4388
+ __Pyx_INCREF(__pyx_n_s_Optional);
4389
+ __Pyx_GIVEREF(__pyx_n_s_Optional);
4390
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_Optional)) __PYX_ERR(0, 5, __pyx_L1_error);
4391
+ __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)
4392
+ __Pyx_GOTREF(__pyx_t_2);
4393
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4394
+ __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Optional); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error)
4395
+ __Pyx_GOTREF(__pyx_t_3);
4396
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_Optional, __pyx_t_3) < 0) __PYX_ERR(0, 5, __pyx_L1_error)
4397
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4398
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4399
+
4400
+ /* "ulid_transform/_ulid_impl.pyx":17
3877
4401
  *
3878
4402
  *
3879
4403
  * def _ulid_now() -> str: # <<<<<<<<<<<<<<
3880
4404
  * return _cpp_ulid().decode("ascii")
3881
4405
  *
3882
4406
  */
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)
4407
+ __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error)
3887
4408
  __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)
4409
+ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
4410
+ __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)
4411
+ __Pyx_GOTREF(__pyx_t_3);
4412
+ __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2);
3891
4413
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4414
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ulid_now, __pyx_t_3) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
4415
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3892
4416
 
3893
- /* "ulid_transform/_ulid_impl.pyx":19
4417
+ /* "ulid_transform/_ulid_impl.pyx":20
3894
4418
  * return _cpp_ulid().decode("ascii")
3895
4419
  *
3896
4420
  * def _ulid_at_time(_time: float) -> str: # <<<<<<<<<<<<<<
3897
4421
  * return _cpp_ulid_at_time(_time).decode("ascii")
3898
4422
  *
3899
4423
  */
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)
4424
+ __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 20, __pyx_L1_error)
3905
4425
  __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)
4426
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_time, __pyx_n_s_float) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
4427
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
4428
+ __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)
4429
+ __Pyx_GOTREF(__pyx_t_2);
4430
+ __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3);
3909
4431
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4432
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ulid_at_time, __pyx_t_2) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
4433
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3910
4434
 
3911
- /* "ulid_transform/_ulid_impl.pyx":22
4435
+ /* "ulid_transform/_ulid_impl.pyx":23
3912
4436
  * return _cpp_ulid_at_time(_time).decode("ascii")
3913
4437
  *
3914
4438
  * def _ulid_to_bytes(ulid_str: str) -> bytes: # <<<<<<<<<<<<<<
3915
4439
  * if len(ulid_str) != 26:
3916
4440
  * raise ValueError(f"ULID must be a 26 character string: {ulid_str}")
3917
4441
  */
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)
4442
+ __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error)
3923
4443
  __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)
4444
+ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ulid_str, __pyx_n_s_str) < 0) __PYX_ERR(0, 23, __pyx_L1_error)
4445
+ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_bytes) < 0) __PYX_ERR(0, 23, __pyx_L1_error)
4446
+ __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)
4447
+ __Pyx_GOTREF(__pyx_t_3);
4448
+ __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2);
3927
4449
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4450
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ulid_to_bytes, __pyx_t_3) < 0) __PYX_ERR(0, 23, __pyx_L1_error)
4451
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3928
4452
 
3929
- /* "ulid_transform/_ulid_impl.pyx":27
4453
+ /* "ulid_transform/_ulid_impl.pyx":28
3930
4454
  * return _cpp_ulid_to_bytes(ulid_str.encode("ascii"))
3931
4455
  *
3932
4456
  * def _bytes_to_ulid(ulid_bytes: bytes) -> str: # <<<<<<<<<<<<<<
3933
4457
  * if len(ulid_bytes) != 16:
3934
4458
  * raise ValueError(f"ULID bytes be 16 bytes: {ulid_bytes}")
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_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error)
4461
+ __Pyx_GOTREF(__pyx_t_3);
4462
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_ulid_bytes, __pyx_n_s_bytes) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
4463
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
4464
+ __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)
4465
+ __Pyx_GOTREF(__pyx_t_2);
4466
+ __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3);
4467
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4468
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_bytes_to_ulid, __pyx_t_2) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
4469
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4470
+
4471
+ /* "ulid_transform/_ulid_impl.pyx":33
4472
+ * return _cpp_bytes_to_ulid(ulid_bytes).decode("ascii")
4473
+ *
4474
+ * def _ulid_to_bytes_or_none(ulid_str: Optional[str]) -> Optional[bytes]: # <<<<<<<<<<<<<<
4475
+ * if ulid_str is None or len(ulid_str) != 26:
4476
+ * return None
4477
+ */
4478
+ __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error)
3937
4479
  __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)
4480
+ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ulid_str, __pyx_kp_s_Optional_str) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
4481
+ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_kp_s_Optional_bytes) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
4482
+ __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
4483
  __Pyx_GOTREF(__pyx_t_3);
3942
4484
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2);
3943
4485
  __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)
4486
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ulid_to_bytes_or_none, __pyx_t_3) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
3945
4487
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3946
4488
 
4489
+ /* "ulid_transform/_ulid_impl.pyx":38
4490
+ * return _cpp_ulid_to_bytes(ulid_str.encode("ascii"))
4491
+ *
4492
+ * def _bytes_to_ulid_or_none(ulid_bytes: Optional[bytes]) -> Optional[str]: # <<<<<<<<<<<<<<
4493
+ * if ulid_bytes is None or len(ulid_bytes) != 16:
4494
+ * return None
4495
+ */
4496
+ __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 38, __pyx_L1_error)
4497
+ __Pyx_GOTREF(__pyx_t_3);
4498
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_ulid_bytes, __pyx_kp_s_Optional_bytes) < 0) __PYX_ERR(0, 38, __pyx_L1_error)
4499
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Optional_str) < 0) __PYX_ERR(0, 38, __pyx_L1_error)
4500
+ __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)
4501
+ __Pyx_GOTREF(__pyx_t_2);
4502
+ __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3);
4503
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4504
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_bytes_to_ulid_or_none, __pyx_t_2) < 0) __PYX_ERR(0, 38, __pyx_L1_error)
4505
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4506
+
3947
4507
  /* "ulid_transform/_ulid_impl.pyx":1
3948
4508
  * # distutils: language = c++ # <<<<<<<<<<<<<<
3949
4509
  * from libcpp.string cimport string
3950
4510
  *
3951
4511
  */
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;
4512
+ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
4513
+ __Pyx_GOTREF(__pyx_t_2);
4514
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4515
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3956
4516
 
3957
4517
  /*--- Wrapped vars code ---*/
3958
4518
 
@@ -4140,14 +4700,20 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject
4140
4700
  #endif
4141
4701
 
4142
4702
  /* PyObjectGetAttrStrNoError */
4703
+ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1
4143
4704
  static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
4144
4705
  __Pyx_PyThreadState_declare
4145
4706
  __Pyx_PyThreadState_assign
4146
4707
  if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
4147
4708
  __Pyx_PyErr_Clear();
4148
4709
  }
4710
+ #endif
4149
4711
  static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
4150
4712
  PyObject *result;
4713
+ #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
4714
+ (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
4715
+ return result;
4716
+ #else
4151
4717
  #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
4152
4718
  PyTypeObject* tp = Py_TYPE(obj);
4153
4719
  if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
@@ -4159,6 +4725,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, P
4159
4725
  __Pyx_PyObject_GetAttrStr_ClearAttributeError();
4160
4726
  }
4161
4727
  return result;
4728
+ #endif
4162
4729
  }
4163
4730
 
4164
4731
  /* GetBuiltinName */
@@ -4374,12 +4941,30 @@ static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyO
4374
4941
  {
4375
4942
  int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ);
4376
4943
  if (unlikely(eq != 0)) {
4377
- if (unlikely(eq < 0)) return NULL; // error
4944
+ if (unlikely(eq < 0)) return NULL;
4378
4945
  return kwvalues[i];
4379
4946
  }
4380
4947
  }
4381
- return NULL; // not found (no exception set)
4948
+ return NULL;
4382
4949
  }
4950
+ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
4951
+ CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
4952
+ Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames);
4953
+ PyObject *dict;
4954
+ dict = PyDict_New();
4955
+ if (unlikely(!dict))
4956
+ return NULL;
4957
+ for (i=0; i<nkwargs; i++) {
4958
+ PyObject *key = PyTuple_GET_ITEM(kwnames, i);
4959
+ if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
4960
+ goto bad;
4961
+ }
4962
+ return dict;
4963
+ bad:
4964
+ Py_DECREF(dict);
4965
+ return NULL;
4966
+ }
4967
+ #endif
4383
4968
  #endif
4384
4969
 
4385
4970
  /* decode_c_bytes */
@@ -4474,7 +5059,7 @@ static int __Pyx_ParseOptionalKeywords(
4474
5059
  if (*name) {
4475
5060
  values[name-argnames] = value;
4476
5061
  #if CYTHON_AVOID_BORROWED_REFS
4477
- Py_INCREF(value); // transfer ownership of value to values
5062
+ Py_INCREF(value);
4478
5063
  Py_DECREF(key);
4479
5064
  #endif
4480
5065
  key = NULL;
@@ -4493,7 +5078,7 @@ static int __Pyx_ParseOptionalKeywords(
4493
5078
  && _PyString_Eq(**name, key)) {
4494
5079
  values[name-argnames] = value;
4495
5080
  #if CYTHON_AVOID_BORROWED_REFS
4496
- value = NULL; // ownership transferred to values
5081
+ value = NULL;
4497
5082
  #endif
4498
5083
  break;
4499
5084
  }
@@ -4525,7 +5110,7 @@ static int __Pyx_ParseOptionalKeywords(
4525
5110
  if (cmp == 0) {
4526
5111
  values[name-argnames] = value;
4527
5112
  #if CYTHON_AVOID_BORROWED_REFS
4528
- value = NULL; // ownership transferred to values
5113
+ value = NULL;
4529
5114
  #endif
4530
5115
  break;
4531
5116
  }
@@ -4677,9 +5262,15 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
4677
5262
  PyObject *result;
4678
5263
  assert(kwargs == NULL || PyDict_Check(kwargs));
4679
5264
  nk = kwargs ? PyDict_Size(kwargs) : 0;
5265
+ #if PY_MAJOR_VERSION < 3
4680
5266
  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) {
4681
5267
  return NULL;
4682
5268
  }
5269
+ #else
5270
+ if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) {
5271
+ return NULL;
5272
+ }
5273
+ #endif
4683
5274
  if (
4684
5275
  #if PY_MAJOR_VERSION >= 3
4685
5276
  co->co_kwonlyargcount == 0 &&
@@ -4756,8 +5347,13 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg
4756
5347
  ternaryfunc call = Py_TYPE(func)->tp_call;
4757
5348
  if (unlikely(!call))
4758
5349
  return PyObject_Call(func, arg, kw);
5350
+ #if PY_MAJOR_VERSION < 3
4759
5351
  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
4760
5352
  return NULL;
5353
+ #else
5354
+ if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
5355
+ return NULL;
5356
+ #endif
4761
5357
  result = (*call)(func, arg, kw);
4762
5358
  Py_LeaveRecursiveCall();
4763
5359
  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
@@ -4776,8 +5372,13 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject
4776
5372
  PyCFunction cfunc;
4777
5373
  cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
4778
5374
  self = __Pyx_CyOrPyCFunction_GET_SELF(func);
5375
+ #if PY_MAJOR_VERSION < 3
4779
5376
  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
4780
5377
  return NULL;
5378
+ #else
5379
+ if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
5380
+ return NULL;
5381
+ #endif
4781
5382
  result = cfunc(self, arg);
4782
5383
  Py_LeaveRecursiveCall();
4783
5384
  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
@@ -4842,7 +5443,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj
4842
5443
  #endif
4843
5444
  if (kwargs == NULL) {
4844
5445
  #if CYTHON_VECTORCALL
4845
- #if Py_VERSION_HEX < 0x03090000
5446
+ #if PY_VERSION_HEX < 0x03090000
4846
5447
  vectorcallfunc f = _PyVectorcall_Function(func);
4847
5448
  #else
4848
5449
  vectorcallfunc f = PyVectorcall_Function(func);
@@ -5210,10 +5811,7 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject
5210
5811
 
5211
5812
  /* FetchSharedCythonModule */
5212
5813
  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;
5814
+ return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME);
5217
5815
  }
5218
5816
 
5219
5817
  /* FetchCommonType */
@@ -6197,7 +6795,7 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func,
6197
6795
  default:
6198
6796
  return NULL;
6199
6797
  }
6200
- return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames);
6798
+ return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames);
6201
6799
  }
6202
6800
  static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
6203
6801
  {
@@ -6562,8 +7160,8 @@ static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject
6562
7160
  Py_DECREF(replace);
6563
7161
  return result;
6564
7162
  }
6565
- #if __PYX_LIMITED_VERSION_HEX < 0x030780000
6566
7163
  PyErr_Clear();
7164
+ #if __PYX_LIMITED_VERSION_HEX < 0x030780000
6567
7165
  {
6568
7166
  PyObject *compiled = NULL, *result = NULL;
6569
7167
  if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL;
@@ -6583,6 +7181,8 @@ static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject
6583
7181
  if (result) Py_INCREF(result);
6584
7182
  return result;
6585
7183
  }
7184
+ #else
7185
+ return NULL;
6586
7186
  #endif
6587
7187
  }
6588
7188
  static void __Pyx_AddTraceback(const char *funcname, int c_line,
@@ -6680,7 +7280,7 @@ static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
6680
7280
  #else
6681
7281
  py_code = PyCode_NewEmpty(filename, funcname, py_line);
6682
7282
  #endif
6683
- Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline
7283
+ Py_XDECREF(py_funcname);
6684
7284
  return py_code;
6685
7285
  bad:
6686
7286
  Py_XDECREF(py_funcname);
@@ -6739,7 +7339,7 @@ __Pyx_PyType_GetName(PyTypeObject* tp)
6739
7339
  if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) {
6740
7340
  PyErr_Clear();
6741
7341
  Py_XDECREF(name);
6742
- name = __Pyx_NewRef(__pyx_n_s__9);
7342
+ name = __Pyx_NewRef(__pyx_n_s__11);
6743
7343
  }
6744
7344
  return name;
6745
7345
  }
@@ -6778,13 +7378,13 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
6778
7378
  {
6779
7379
  int one = 1; int little = (int)*(unsigned char *)&one;
6780
7380
  unsigned char *bytes = (unsigned char *)&value;
6781
- #if !CYTHON_COMPILING_IN_LIMITED_API
7381
+ #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
6782
7382
  return _PyLong_FromByteArray(bytes, sizeof(long),
6783
7383
  little, !is_unsigned);
6784
7384
  #else
6785
7385
  PyObject *from_bytes, *result = NULL;
6786
7386
  PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
6787
- from_bytes = PyObject_GetAttrString((PyObject*)&PyInt_Type, "from_bytes");
7387
+ from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
6788
7388
  if (!from_bytes) return NULL;
6789
7389
  py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long));
6790
7390
  if (!py_bytes) goto limited_bad;
@@ -6792,16 +7392,18 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
6792
7392
  if (!order_str) goto limited_bad;
6793
7393
  arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
6794
7394
  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;
7395
+ if (!is_unsigned) {
7396
+ kwds = PyDict_New();
7397
+ if (!kwds) goto limited_bad;
7398
+ if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
7399
+ }
6798
7400
  result = PyObject_Call(from_bytes, arg_tuple, kwds);
6799
7401
  limited_bad:
6800
- Py_XDECREF(from_bytes);
6801
- Py_XDECREF(py_bytes);
6802
- Py_XDECREF(order_str);
6803
- Py_XDECREF(arg_tuple);
6804
7402
  Py_XDECREF(kwds);
7403
+ Py_XDECREF(arg_tuple);
7404
+ Py_XDECREF(order_str);
7405
+ Py_XDECREF(py_bytes);
7406
+ Py_XDECREF(from_bytes);
6805
7407
  return result;
6806
7408
  #endif
6807
7409
  }
@@ -6999,7 +7601,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
6999
7601
  #endif
7000
7602
  if (likely(v)) {
7001
7603
  int ret = -1;
7002
- #if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
7604
+ #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
7003
7605
  int one = 1; int is_little = (int)*(unsigned char *)&one;
7004
7606
  unsigned char *bytes = (unsigned char *)&val;
7005
7607
  ret = _PyLong_AsByteArray((PyLongObject *)v,
@@ -7272,7 +7874,7 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
7272
7874
  #endif
7273
7875
  if (likely(v)) {
7274
7876
  int ret = -1;
7275
- #if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
7877
+ #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
7276
7878
  int one = 1; int is_little = (int)*(unsigned char *)&one;
7277
7879
  unsigned char *bytes = (unsigned char *)&val;
7278
7880
  ret = _PyLong_AsByteArray((PyLongObject *)v,
@@ -7492,7 +8094,7 @@ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObj
7492
8094
  #endif
7493
8095
 
7494
8096
  /* CheckBinaryVersion */
7495
- static unsigned long __Pyx_get_runtime_version() {
8097
+ static unsigned long __Pyx_get_runtime_version(void) {
7496
8098
  #if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4
7497
8099
  return Py_Version & ~0xFFUL;
7498
8100
  #else