ulid-transform 0.8.1__cp310-cp310-win_amd64.whl → 0.10.1__cp310-cp310-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ulid_transform/__init__.py +19 -3
- ulid_transform/_ulid_impl.cp310-win_amd64.pyd +0 -0
- ulid_transform/_ulid_impl.cpp +991 -315
- ulid_transform/_ulid_impl.pyx +11 -0
- ulid_transform/ulid_impl.py +26 -0
- {ulid_transform-0.8.1.dist-info → ulid_transform-0.10.1.dist-info}/METADATA +8 -1
- ulid_transform-0.10.1.dist-info/RECORD +15 -0
- {ulid_transform-0.8.1.dist-info → ulid_transform-0.10.1.dist-info}/WHEEL +1 -1
- ulid_transform-0.8.1.dist-info/RECORD +0 -15
- {ulid_transform-0.8.1.dist-info → ulid_transform-0.10.1.dist-info}/LICENSE +0 -0
ulid_transform/_ulid_impl.cpp
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
/* Generated by Cython 3.0.
|
1
|
+
/* Generated by Cython 3.0.10 */
|
2
2
|
|
3
3
|
/* BEGIN: Cython Metadata
|
4
4
|
{
|
@@ -45,15 +45,15 @@ END: Cython Metadata */
|
|
45
45
|
#elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
|
46
46
|
#error Cython requires Python 2.7+ or Python 3.3+.
|
47
47
|
#else
|
48
|
-
#if CYTHON_LIMITED_API
|
48
|
+
#if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API
|
49
49
|
#define __PYX_EXTRA_ABI_MODULE_NAME "limited"
|
50
50
|
#else
|
51
51
|
#define __PYX_EXTRA_ABI_MODULE_NAME ""
|
52
52
|
#endif
|
53
|
-
#define CYTHON_ABI "
|
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
|
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
|
-
#
|
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)
|
@@ -610,17 +640,20 @@ class __Pyx_FakeReference {
|
|
610
640
|
PyObject *name, int fline, PyObject *lnos) {
|
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
|
644
|
+
PyObject *version_info;
|
614
645
|
PyObject *py_minor_version = NULL;
|
646
|
+
#endif
|
615
647
|
long minor_version = 0;
|
616
648
|
PyObject *type, *value, *traceback;
|
617
649
|
PyErr_Fetch(&type, &value, &traceback);
|
618
650
|
#if __PYX_LIMITED_VERSION_HEX >= 0x030B0000
|
619
|
-
minor_version = 11;
|
651
|
+
minor_version = 11;
|
620
652
|
#else
|
621
653
|
if (!(version_info = PySys_GetObject("version_info"))) goto end;
|
622
654
|
if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end;
|
623
655
|
minor_version = PyLong_AsLong(py_minor_version);
|
656
|
+
Py_DECREF(py_minor_version);
|
624
657
|
if (minor_version == -1 && PyErr_Occurred()) goto end;
|
625
658
|
#endif
|
626
659
|
if (!(types_module = PyImport_ImportModule("types"))) goto end;
|
@@ -641,7 +674,6 @@ class __Pyx_FakeReference {
|
|
641
674
|
Py_XDECREF(code_type);
|
642
675
|
Py_XDECREF(exception_table);
|
643
676
|
Py_XDECREF(types_module);
|
644
|
-
Py_XDECREF(py_minor_version);
|
645
677
|
if (type) {
|
646
678
|
PyErr_Restore(type, value, traceback);
|
647
679
|
}
|
@@ -674,7 +706,7 @@ class __Pyx_FakeReference {
|
|
674
706
|
PyObject *fv, PyObject *cell, PyObject* fn,
|
675
707
|
PyObject *name, int fline, PyObject *lnos) {
|
676
708
|
PyCodeObject *result;
|
677
|
-
PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0);
|
709
|
+
PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0);
|
678
710
|
if (!empty_bytes) return NULL;
|
679
711
|
result =
|
680
712
|
#if PY_VERSION_HEX >= 0x030C0000
|
@@ -760,8 +792,13 @@ class __Pyx_FakeReference {
|
|
760
792
|
typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
|
761
793
|
Py_ssize_t nargs, PyObject *kwnames);
|
762
794
|
#else
|
763
|
-
#
|
764
|
-
#define
|
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
|
765
802
|
#endif
|
766
803
|
#if CYTHON_METH_FASTCALL
|
767
804
|
#define __Pyx_METH_FASTCALL METH_FASTCALL
|
@@ -785,6 +822,31 @@ class __Pyx_FakeReference {
|
|
785
822
|
#define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0
|
786
823
|
#define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n))
|
787
824
|
#endif
|
825
|
+
#if PY_MAJOR_VERSION >= 0x030900B1
|
826
|
+
#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func)
|
827
|
+
#else
|
828
|
+
#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func)
|
829
|
+
#endif
|
830
|
+
#define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func)
|
831
|
+
#if CYTHON_COMPILING_IN_CPYTHON
|
832
|
+
#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth)
|
833
|
+
#elif !CYTHON_COMPILING_IN_LIMITED_API
|
834
|
+
#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func)
|
835
|
+
#endif
|
836
|
+
#if CYTHON_COMPILING_IN_CPYTHON
|
837
|
+
#define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags)
|
838
|
+
static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
|
839
|
+
return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
|
840
|
+
}
|
841
|
+
#endif
|
842
|
+
static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) {
|
843
|
+
#if CYTHON_COMPILING_IN_LIMITED_API
|
844
|
+
return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
|
845
|
+
#else
|
846
|
+
return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
|
847
|
+
#endif
|
848
|
+
}
|
849
|
+
#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc)
|
788
850
|
#if __PYX_LIMITED_VERSION_HEX < 0x030900B1
|
789
851
|
#define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b))
|
790
852
|
typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *);
|
@@ -811,6 +873,8 @@ class __Pyx_FakeReference {
|
|
811
873
|
#define __Pyx_PyThreadState_Current PyThreadState_Get()
|
812
874
|
#elif !CYTHON_FAST_THREAD_STATE
|
813
875
|
#define __Pyx_PyThreadState_Current PyThreadState_GET()
|
876
|
+
#elif PY_VERSION_HEX >= 0x030d00A1
|
877
|
+
#define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
|
814
878
|
#elif PY_VERSION_HEX >= 0x03060000
|
815
879
|
#define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
|
816
880
|
#elif PY_VERSION_HEX >= 0x03000000
|
@@ -886,7 +950,7 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
|
|
886
950
|
}
|
887
951
|
#endif
|
888
952
|
#endif
|
889
|
-
#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
|
953
|
+
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized)
|
890
954
|
#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
|
891
955
|
#else
|
892
956
|
#define __Pyx_PyDict_NewPresized(n) PyDict_New()
|
@@ -898,7 +962,7 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
|
|
898
962
|
#define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
|
899
963
|
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
|
900
964
|
#endif
|
901
|
-
#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
|
902
966
|
#define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
|
903
967
|
static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
|
904
968
|
PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
|
@@ -942,7 +1006,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict,
|
|
942
1006
|
#endif
|
943
1007
|
#if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000
|
944
1008
|
#define __Pyx_PyHeapTypeObject_GC_Del(obj) {\
|
945
|
-
PyTypeObject *type = Py_TYPE(obj);\
|
1009
|
+
PyTypeObject *type = Py_TYPE((PyObject*)obj);\
|
946
1010
|
assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
|
947
1011
|
PyObject_GC_Del(obj);\
|
948
1012
|
Py_DECREF(type);\
|
@@ -1086,6 +1150,15 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict,
|
|
1086
1150
|
#define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
|
1087
1151
|
#define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
|
1088
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
|
1089
1162
|
#if PY_MAJOR_VERSION >= 3
|
1090
1163
|
#define PyIntObject PyLongObject
|
1091
1164
|
#define PyInt_Type PyLong_Type
|
@@ -1164,7 +1237,7 @@ static CYTHON_INLINE float __PYX_NAN() {
|
|
1164
1237
|
#endif
|
1165
1238
|
|
1166
1239
|
#define __PYX_MARK_ERR_POS(f_index, lineno) \
|
1167
|
-
{ __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__;
|
1240
|
+
{ __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
|
1168
1241
|
#define __PYX_ERR(f_index, lineno, Ln_error) \
|
1169
1242
|
{ __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
|
1170
1243
|
|
@@ -1239,9 +1312,10 @@ static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
|
|
1239
1312
|
#else
|
1240
1313
|
#define __Pyx_sst_abs(value) ((value<0) ? -value : value)
|
1241
1314
|
#endif
|
1315
|
+
static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s);
|
1242
1316
|
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
|
1243
1317
|
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
|
1244
|
-
|
1318
|
+
static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*);
|
1245
1319
|
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
|
1246
1320
|
#define __Pyx_PyBytes_FromString PyBytes_FromString
|
1247
1321
|
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
|
@@ -1269,24 +1343,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
|
|
1269
1343
|
#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
|
1270
1344
|
#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
|
1271
1345
|
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
|
1272
|
-
#if CYTHON_COMPILING_IN_LIMITED_API
|
1273
|
-
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u)
|
1274
|
-
{
|
1275
|
-
const wchar_t *u_end = u;
|
1276
|
-
while (*u_end++) ;
|
1277
|
-
return (size_t)(u_end - u - 1);
|
1278
|
-
}
|
1279
|
-
#else
|
1280
|
-
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
|
1281
|
-
{
|
1282
|
-
const Py_UNICODE *u_end = u;
|
1283
|
-
while (*u_end++) ;
|
1284
|
-
return (size_t)(u_end - u - 1);
|
1285
|
-
}
|
1286
|
-
#endif
|
1287
1346
|
#define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o)
|
1288
|
-
#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
|
1289
|
-
#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
|
1290
1347
|
#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
|
1291
1348
|
#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
|
1292
1349
|
#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
|
@@ -1336,7 +1393,7 @@ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
|
|
1336
1393
|
#endif
|
1337
1394
|
typedef Py_ssize_t __Pyx_compact_pylong;
|
1338
1395
|
typedef size_t __Pyx_compact_upylong;
|
1339
|
-
#else
|
1396
|
+
#else
|
1340
1397
|
#define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0)
|
1341
1398
|
#define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0)
|
1342
1399
|
#define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0)
|
@@ -1357,6 +1414,7 @@ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
|
|
1357
1414
|
#endif
|
1358
1415
|
#endif
|
1359
1416
|
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
|
1417
|
+
#include <string.h>
|
1360
1418
|
static int __Pyx_sys_getdefaultencoding_not_ascii;
|
1361
1419
|
static int __Pyx_init_sys_getdefaultencoding_params(void) {
|
1362
1420
|
PyObject* sys;
|
@@ -1407,6 +1465,7 @@ bad:
|
|
1407
1465
|
#else
|
1408
1466
|
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
|
1409
1467
|
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
|
1468
|
+
#include <string.h>
|
1410
1469
|
static char* __PYX_DEFAULT_STRING_ENCODING;
|
1411
1470
|
static int __Pyx_init_sys_getdefaultencoding_params(void) {
|
1412
1471
|
PyObject* sys;
|
@@ -1457,6 +1516,11 @@ static const char *__pyx_f[] = {
|
|
1457
1516
|
"<stringsource>",
|
1458
1517
|
};
|
1459
1518
|
/* #### Code section: utility_code_proto_before_types ### */
|
1519
|
+
/* ForceInitThreads.proto */
|
1520
|
+
#ifndef __PYX_FORCE_INIT_THREADS
|
1521
|
+
#define __PYX_FORCE_INIT_THREADS 0
|
1522
|
+
#endif
|
1523
|
+
|
1460
1524
|
/* #### Code section: numeric_typedefs ### */
|
1461
1525
|
/* #### Code section: complex_type_declarations ### */
|
1462
1526
|
/* #### Code section: type_declarations ### */
|
@@ -1635,8 +1699,8 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int
|
|
1635
1699
|
#define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg)
|
1636
1700
|
#define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg)
|
1637
1701
|
#else
|
1638
|
-
#define __Pyx_Arg_NewRef_VARARGS(arg) arg
|
1639
|
-
#define __Pyx_Arg_XDECREF_VARARGS(arg)
|
1702
|
+
#define __Pyx_Arg_NewRef_VARARGS(arg) arg
|
1703
|
+
#define __Pyx_Arg_XDECREF_VARARGS(arg)
|
1640
1704
|
#endif
|
1641
1705
|
#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
|
1642
1706
|
#define __Pyx_KwValues_VARARGS(args, nargs) NULL
|
@@ -1647,9 +1711,14 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int
|
|
1647
1711
|
#define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds)
|
1648
1712
|
#define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
|
1649
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
|
1650
1717
|
#define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
|
1651
|
-
|
1652
|
-
#define
|
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)
|
1653
1722
|
#else
|
1654
1723
|
#define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS
|
1655
1724
|
#define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
|
@@ -1909,7 +1978,7 @@ typedef struct {
|
|
1909
1978
|
#endif
|
1910
1979
|
void *defaults;
|
1911
1980
|
int defaults_pyobjects;
|
1912
|
-
size_t defaults_size;
|
1981
|
+
size_t defaults_size;
|
1913
1982
|
int flags;
|
1914
1983
|
PyObject *defaults_tuple;
|
1915
1984
|
PyObject *defaults_kwdict;
|
@@ -1917,9 +1986,13 @@ typedef struct {
|
|
1917
1986
|
PyObject *func_annotations;
|
1918
1987
|
PyObject *func_is_coroutine;
|
1919
1988
|
} __pyx_CyFunctionObject;
|
1989
|
+
#undef __Pyx_CyOrPyCFunction_Check
|
1920
1990
|
#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType)
|
1921
|
-
#define
|
1991
|
+
#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type)
|
1922
1992
|
#define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType)
|
1993
|
+
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc);
|
1994
|
+
#undef __Pyx_IsSameCFunction
|
1995
|
+
#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc)
|
1923
1996
|
static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
|
1924
1997
|
int flags, PyObject* qualname,
|
1925
1998
|
PyObject *closure,
|
@@ -2096,7 +2169,8 @@ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObj
|
|
2096
2169
|
#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
|
2097
2170
|
|
2098
2171
|
/* CheckBinaryVersion.proto */
|
2099
|
-
static
|
2172
|
+
static unsigned long __Pyx_get_runtime_version(void);
|
2173
|
+
static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer);
|
2100
2174
|
|
2101
2175
|
/* InitStrings.proto */
|
2102
2176
|
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
|
@@ -2110,12 +2184,12 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
|
|
2110
2184
|
/* Module declarations from "cython" */
|
2111
2185
|
|
2112
2186
|
/* Module declarations from "ulid_transform._ulid_impl" */
|
2113
|
-
static CYTHON_INLINE PyObject *
|
2114
|
-
static CYTHON_INLINE PyObject *
|
2115
|
-
static CYTHON_INLINE PyObject *
|
2116
|
-
static CYTHON_INLINE PyObject *
|
2117
|
-
static CYTHON_INLINE PyObject *
|
2118
|
-
static std::string
|
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*/
|
2119
2193
|
/* #### Code section: typeinfo ### */
|
2120
2194
|
/* #### Code section: before_global_var ### */
|
2121
2195
|
#define __Pyx_MODULE_NAME "ulid_transform._ulid_impl"
|
@@ -2127,7 +2201,7 @@ int __pyx_module_is_main_ulid_transform___ulid_impl = 0;
|
|
2127
2201
|
static PyObject *__pyx_builtin_ValueError;
|
2128
2202
|
/* #### Code section: string_decls ### */
|
2129
2203
|
static const char __pyx_k_[] = ".";
|
2130
|
-
static const char
|
2204
|
+
static const char __pyx_k__11[] = "?";
|
2131
2205
|
static const char __pyx_k_str[] = "str";
|
2132
2206
|
static const char __pyx_k_main[] = "__main__";
|
2133
2207
|
static const char __pyx_k_name[] = "__name__";
|
@@ -2138,16 +2212,22 @@ static const char __pyx_k_float[] = "float";
|
|
2138
2212
|
static const char __pyx_k_import[] = "__import__";
|
2139
2213
|
static const char __pyx_k_return[] = "return";
|
2140
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";
|
2141
2217
|
static const char __pyx_k_ulid_now[] = "_ulid_now";
|
2142
2218
|
static const char __pyx_k_ulid_str[] = "ulid_str";
|
2143
2219
|
static const char __pyx_k_ValueError[] = "ValueError";
|
2144
2220
|
static const char __pyx_k_ulid_bytes[] = "ulid_bytes";
|
2221
|
+
static const char __pyx_k_Optional_str[] = "Optional[str]";
|
2145
2222
|
static const char __pyx_k_is_coroutine[] = "_is_coroutine";
|
2146
2223
|
static const char __pyx_k_ulid_at_time[] = "_ulid_at_time";
|
2147
2224
|
static const char __pyx_k_bytes_to_ulid[] = "_bytes_to_ulid";
|
2148
2225
|
static const char __pyx_k_ulid_to_bytes[] = "_ulid_to_bytes";
|
2226
|
+
static const char __pyx_k_Optional_bytes[] = "Optional[bytes]";
|
2149
2227
|
static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines";
|
2150
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";
|
2151
2231
|
static const char __pyx_k_ULID_bytes_be_16_bytes[] = "ULID bytes be 16 bytes: ";
|
2152
2232
|
static const char __pyx_k_ulid_transform__ulid_impl[] = "ulid_transform._ulid_impl";
|
2153
2233
|
static const char __pyx_k_ULID_must_be_a_26_character_stri[] = "ULID must be a 26 character string: ";
|
@@ -2157,6 +2237,8 @@ static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl__ulid_now(CYTHON_UNUSED
|
|
2157
2237
|
static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl_2_ulid_at_time(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v__time); /* proto */
|
2158
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 */
|
2159
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 */
|
2160
2242
|
/* #### Code section: late_includes ### */
|
2161
2243
|
/* #### Code section: module_state ### */
|
2162
2244
|
typedef struct {
|
@@ -2193,13 +2275,17 @@ typedef struct {
|
|
2193
2275
|
#if CYTHON_USE_MODULE_STATE
|
2194
2276
|
#endif
|
2195
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;
|
2196
2281
|
PyObject *__pyx_kp_u_ULID_bytes_be_16_bytes;
|
2197
2282
|
PyObject *__pyx_kp_u_ULID_must_be_a_26_character_stri;
|
2198
2283
|
PyObject *__pyx_n_s_ValueError;
|
2199
|
-
PyObject *
|
2284
|
+
PyObject *__pyx_n_s__11;
|
2200
2285
|
PyObject *__pyx_n_s_asyncio_coroutines;
|
2201
2286
|
PyObject *__pyx_n_s_bytes;
|
2202
2287
|
PyObject *__pyx_n_s_bytes_to_ulid;
|
2288
|
+
PyObject *__pyx_n_s_bytes_to_ulid_or_none;
|
2203
2289
|
PyObject *__pyx_n_s_cline_in_traceback;
|
2204
2290
|
PyObject *__pyx_n_s_float;
|
2205
2291
|
PyObject *__pyx_n_s_import;
|
@@ -2212,11 +2298,13 @@ typedef struct {
|
|
2212
2298
|
PyObject *__pyx_n_s_test;
|
2213
2299
|
PyObject *__pyx_n_s_time;
|
2214
2300
|
PyObject *__pyx_n_s_time_2;
|
2301
|
+
PyObject *__pyx_n_s_typing;
|
2215
2302
|
PyObject *__pyx_n_s_ulid_at_time;
|
2216
2303
|
PyObject *__pyx_n_s_ulid_bytes;
|
2217
2304
|
PyObject *__pyx_n_s_ulid_now;
|
2218
2305
|
PyObject *__pyx_n_s_ulid_str;
|
2219
2306
|
PyObject *__pyx_n_s_ulid_to_bytes;
|
2307
|
+
PyObject *__pyx_n_s_ulid_to_bytes_or_none;
|
2220
2308
|
PyObject *__pyx_n_s_ulid_transform__ulid_impl;
|
2221
2309
|
PyObject *__pyx_tuple__3;
|
2222
2310
|
PyObject *__pyx_tuple__5;
|
@@ -2225,6 +2313,8 @@ typedef struct {
|
|
2225
2313
|
PyObject *__pyx_codeobj__4;
|
2226
2314
|
PyObject *__pyx_codeobj__6;
|
2227
2315
|
PyObject *__pyx_codeobj__8;
|
2316
|
+
PyObject *__pyx_codeobj__9;
|
2317
|
+
PyObject *__pyx_codeobj__10;
|
2228
2318
|
} __pyx_mstate;
|
2229
2319
|
|
2230
2320
|
#if CYTHON_USE_MODULE_STATE
|
@@ -2268,13 +2358,17 @@ static int __pyx_m_clear(PyObject *m) {
|
|
2268
2358
|
Py_CLEAR(clear_module_state->__pyx_FusedFunctionType);
|
2269
2359
|
#endif
|
2270
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);
|
2271
2364
|
Py_CLEAR(clear_module_state->__pyx_kp_u_ULID_bytes_be_16_bytes);
|
2272
2365
|
Py_CLEAR(clear_module_state->__pyx_kp_u_ULID_must_be_a_26_character_stri);
|
2273
2366
|
Py_CLEAR(clear_module_state->__pyx_n_s_ValueError);
|
2274
|
-
Py_CLEAR(clear_module_state->
|
2367
|
+
Py_CLEAR(clear_module_state->__pyx_n_s__11);
|
2275
2368
|
Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines);
|
2276
2369
|
Py_CLEAR(clear_module_state->__pyx_n_s_bytes);
|
2277
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);
|
2278
2372
|
Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback);
|
2279
2373
|
Py_CLEAR(clear_module_state->__pyx_n_s_float);
|
2280
2374
|
Py_CLEAR(clear_module_state->__pyx_n_s_import);
|
@@ -2287,11 +2381,13 @@ static int __pyx_m_clear(PyObject *m) {
|
|
2287
2381
|
Py_CLEAR(clear_module_state->__pyx_n_s_test);
|
2288
2382
|
Py_CLEAR(clear_module_state->__pyx_n_s_time);
|
2289
2383
|
Py_CLEAR(clear_module_state->__pyx_n_s_time_2);
|
2384
|
+
Py_CLEAR(clear_module_state->__pyx_n_s_typing);
|
2290
2385
|
Py_CLEAR(clear_module_state->__pyx_n_s_ulid_at_time);
|
2291
2386
|
Py_CLEAR(clear_module_state->__pyx_n_s_ulid_bytes);
|
2292
2387
|
Py_CLEAR(clear_module_state->__pyx_n_s_ulid_now);
|
2293
2388
|
Py_CLEAR(clear_module_state->__pyx_n_s_ulid_str);
|
2294
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);
|
2295
2391
|
Py_CLEAR(clear_module_state->__pyx_n_s_ulid_transform__ulid_impl);
|
2296
2392
|
Py_CLEAR(clear_module_state->__pyx_tuple__3);
|
2297
2393
|
Py_CLEAR(clear_module_state->__pyx_tuple__5);
|
@@ -2300,6 +2396,8 @@ static int __pyx_m_clear(PyObject *m) {
|
|
2300
2396
|
Py_CLEAR(clear_module_state->__pyx_codeobj__4);
|
2301
2397
|
Py_CLEAR(clear_module_state->__pyx_codeobj__6);
|
2302
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);
|
2303
2401
|
return 0;
|
2304
2402
|
}
|
2305
2403
|
#endif
|
@@ -2321,13 +2419,17 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
|
|
2321
2419
|
Py_VISIT(traverse_module_state->__pyx_FusedFunctionType);
|
2322
2420
|
#endif
|
2323
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);
|
2324
2425
|
Py_VISIT(traverse_module_state->__pyx_kp_u_ULID_bytes_be_16_bytes);
|
2325
2426
|
Py_VISIT(traverse_module_state->__pyx_kp_u_ULID_must_be_a_26_character_stri);
|
2326
2427
|
Py_VISIT(traverse_module_state->__pyx_n_s_ValueError);
|
2327
|
-
Py_VISIT(traverse_module_state->
|
2428
|
+
Py_VISIT(traverse_module_state->__pyx_n_s__11);
|
2328
2429
|
Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines);
|
2329
2430
|
Py_VISIT(traverse_module_state->__pyx_n_s_bytes);
|
2330
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);
|
2331
2433
|
Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback);
|
2332
2434
|
Py_VISIT(traverse_module_state->__pyx_n_s_float);
|
2333
2435
|
Py_VISIT(traverse_module_state->__pyx_n_s_import);
|
@@ -2340,11 +2442,13 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
|
|
2340
2442
|
Py_VISIT(traverse_module_state->__pyx_n_s_test);
|
2341
2443
|
Py_VISIT(traverse_module_state->__pyx_n_s_time);
|
2342
2444
|
Py_VISIT(traverse_module_state->__pyx_n_s_time_2);
|
2445
|
+
Py_VISIT(traverse_module_state->__pyx_n_s_typing);
|
2343
2446
|
Py_VISIT(traverse_module_state->__pyx_n_s_ulid_at_time);
|
2344
2447
|
Py_VISIT(traverse_module_state->__pyx_n_s_ulid_bytes);
|
2345
2448
|
Py_VISIT(traverse_module_state->__pyx_n_s_ulid_now);
|
2346
2449
|
Py_VISIT(traverse_module_state->__pyx_n_s_ulid_str);
|
2347
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);
|
2348
2452
|
Py_VISIT(traverse_module_state->__pyx_n_s_ulid_transform__ulid_impl);
|
2349
2453
|
Py_VISIT(traverse_module_state->__pyx_tuple__3);
|
2350
2454
|
Py_VISIT(traverse_module_state->__pyx_tuple__5);
|
@@ -2353,6 +2457,8 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
|
|
2353
2457
|
Py_VISIT(traverse_module_state->__pyx_codeobj__4);
|
2354
2458
|
Py_VISIT(traverse_module_state->__pyx_codeobj__6);
|
2355
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);
|
2356
2462
|
return 0;
|
2357
2463
|
}
|
2358
2464
|
#endif
|
@@ -2390,13 +2496,17 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
|
|
2390
2496
|
#if CYTHON_USE_MODULE_STATE
|
2391
2497
|
#endif
|
2392
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
|
2393
2502
|
#define __pyx_kp_u_ULID_bytes_be_16_bytes __pyx_mstate_global->__pyx_kp_u_ULID_bytes_be_16_bytes
|
2394
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
|
2395
2504
|
#define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError
|
2396
|
-
#define
|
2505
|
+
#define __pyx_n_s__11 __pyx_mstate_global->__pyx_n_s__11
|
2397
2506
|
#define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines
|
2398
2507
|
#define __pyx_n_s_bytes __pyx_mstate_global->__pyx_n_s_bytes
|
2399
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
|
2400
2510
|
#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback
|
2401
2511
|
#define __pyx_n_s_float __pyx_mstate_global->__pyx_n_s_float
|
2402
2512
|
#define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import
|
@@ -2409,11 +2519,13 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
|
|
2409
2519
|
#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test
|
2410
2520
|
#define __pyx_n_s_time __pyx_mstate_global->__pyx_n_s_time
|
2411
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
|
2412
2523
|
#define __pyx_n_s_ulid_at_time __pyx_mstate_global->__pyx_n_s_ulid_at_time
|
2413
2524
|
#define __pyx_n_s_ulid_bytes __pyx_mstate_global->__pyx_n_s_ulid_bytes
|
2414
2525
|
#define __pyx_n_s_ulid_now __pyx_mstate_global->__pyx_n_s_ulid_now
|
2415
2526
|
#define __pyx_n_s_ulid_str __pyx_mstate_global->__pyx_n_s_ulid_str
|
2416
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
|
2417
2529
|
#define __pyx_n_s_ulid_transform__ulid_impl __pyx_mstate_global->__pyx_n_s_ulid_transform__ulid_impl
|
2418
2530
|
#define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3
|
2419
2531
|
#define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5
|
@@ -2422,28 +2534,30 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
|
|
2422
2534
|
#define __pyx_codeobj__4 __pyx_mstate_global->__pyx_codeobj__4
|
2423
2535
|
#define __pyx_codeobj__6 __pyx_mstate_global->__pyx_codeobj__6
|
2424
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
|
2425
2539
|
/* #### Code section: module_code ### */
|
2426
2540
|
|
2427
2541
|
/* "string.to_py":31
|
2428
2542
|
*
|
2429
|
-
* @cname("
|
2430
|
-
* cdef inline object
|
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): # <<<<<<<<<<<<<<
|
2431
2545
|
* return __Pyx_PyObject_FromStringAndSize(s.data(), s.size())
|
2432
2546
|
* cdef extern from *:
|
2433
2547
|
*/
|
2434
2548
|
|
2435
|
-
static CYTHON_INLINE PyObject *
|
2549
|
+
static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string(std::string const &__pyx_v_s) {
|
2436
2550
|
PyObject *__pyx_r = NULL;
|
2437
2551
|
__Pyx_RefNannyDeclarations
|
2438
2552
|
PyObject *__pyx_t_1 = NULL;
|
2439
2553
|
int __pyx_lineno = 0;
|
2440
2554
|
const char *__pyx_filename = NULL;
|
2441
2555
|
int __pyx_clineno = 0;
|
2442
|
-
__Pyx_RefNannySetupContext("
|
2556
|
+
__Pyx_RefNannySetupContext("__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string", 1);
|
2443
2557
|
|
2444
2558
|
/* "string.to_py":32
|
2445
|
-
* @cname("
|
2446
|
-
* cdef inline object
|
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):
|
2447
2561
|
* return __Pyx_PyObject_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
|
2448
2562
|
* cdef extern from *:
|
2449
2563
|
* cdef object __Pyx_PyUnicode_FromStringAndSize(const char*, size_t)
|
@@ -2457,8 +2571,8 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_strin
|
|
2457
2571
|
|
2458
2572
|
/* "string.to_py":31
|
2459
2573
|
*
|
2460
|
-
* @cname("
|
2461
|
-
* cdef inline object
|
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): # <<<<<<<<<<<<<<
|
2462
2576
|
* return __Pyx_PyObject_FromStringAndSize(s.data(), s.size())
|
2463
2577
|
* cdef extern from *:
|
2464
2578
|
*/
|
@@ -2466,7 +2580,7 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_strin
|
|
2466
2580
|
/* function exit code */
|
2467
2581
|
__pyx_L1_error:;
|
2468
2582
|
__Pyx_XDECREF(__pyx_t_1);
|
2469
|
-
__Pyx_AddTraceback("string.to_py.
|
2583
|
+
__Pyx_AddTraceback("string.to_py.__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
2470
2584
|
__pyx_r = 0;
|
2471
2585
|
__pyx_L0:;
|
2472
2586
|
__Pyx_XGIVEREF(__pyx_r);
|
@@ -2476,24 +2590,24 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_strin
|
|
2476
2590
|
|
2477
2591
|
/* "string.to_py":37
|
2478
2592
|
*
|
2479
|
-
* @cname("
|
2480
|
-
* cdef inline object
|
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): # <<<<<<<<<<<<<<
|
2481
2595
|
* return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size())
|
2482
2596
|
* cdef extern from *:
|
2483
2597
|
*/
|
2484
2598
|
|
2485
|
-
static CYTHON_INLINE PyObject *
|
2599
|
+
static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(std::string const &__pyx_v_s) {
|
2486
2600
|
PyObject *__pyx_r = NULL;
|
2487
2601
|
__Pyx_RefNannyDeclarations
|
2488
2602
|
PyObject *__pyx_t_1 = NULL;
|
2489
2603
|
int __pyx_lineno = 0;
|
2490
2604
|
const char *__pyx_filename = NULL;
|
2491
2605
|
int __pyx_clineno = 0;
|
2492
|
-
__Pyx_RefNannySetupContext("
|
2606
|
+
__Pyx_RefNannySetupContext("__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string", 1);
|
2493
2607
|
|
2494
2608
|
/* "string.to_py":38
|
2495
|
-
* @cname("
|
2496
|
-
* cdef inline object
|
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):
|
2497
2611
|
* return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
|
2498
2612
|
* cdef extern from *:
|
2499
2613
|
* cdef object __Pyx_PyStr_FromStringAndSize(const char*, size_t)
|
@@ -2507,8 +2621,8 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_stri
|
|
2507
2621
|
|
2508
2622
|
/* "string.to_py":37
|
2509
2623
|
*
|
2510
|
-
* @cname("
|
2511
|
-
* cdef inline object
|
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): # <<<<<<<<<<<<<<
|
2512
2626
|
* return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size())
|
2513
2627
|
* cdef extern from *:
|
2514
2628
|
*/
|
@@ -2516,7 +2630,7 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_stri
|
|
2516
2630
|
/* function exit code */
|
2517
2631
|
__pyx_L1_error:;
|
2518
2632
|
__Pyx_XDECREF(__pyx_t_1);
|
2519
|
-
__Pyx_AddTraceback("string.to_py.
|
2633
|
+
__Pyx_AddTraceback("string.to_py.__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
2520
2634
|
__pyx_r = 0;
|
2521
2635
|
__pyx_L0:;
|
2522
2636
|
__Pyx_XGIVEREF(__pyx_r);
|
@@ -2526,24 +2640,24 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_stri
|
|
2526
2640
|
|
2527
2641
|
/* "string.to_py":43
|
2528
2642
|
*
|
2529
|
-
* @cname("
|
2530
|
-
* cdef inline object
|
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): # <<<<<<<<<<<<<<
|
2531
2645
|
* return __Pyx_PyStr_FromStringAndSize(s.data(), s.size())
|
2532
2646
|
* cdef extern from *:
|
2533
2647
|
*/
|
2534
2648
|
|
2535
|
-
static CYTHON_INLINE PyObject *
|
2649
|
+
static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string(std::string const &__pyx_v_s) {
|
2536
2650
|
PyObject *__pyx_r = NULL;
|
2537
2651
|
__Pyx_RefNannyDeclarations
|
2538
2652
|
PyObject *__pyx_t_1 = NULL;
|
2539
2653
|
int __pyx_lineno = 0;
|
2540
2654
|
const char *__pyx_filename = NULL;
|
2541
2655
|
int __pyx_clineno = 0;
|
2542
|
-
__Pyx_RefNannySetupContext("
|
2656
|
+
__Pyx_RefNannySetupContext("__pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string", 1);
|
2543
2657
|
|
2544
2658
|
/* "string.to_py":44
|
2545
|
-
* @cname("
|
2546
|
-
* cdef inline object
|
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):
|
2547
2661
|
* return __Pyx_PyStr_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
|
2548
2662
|
* cdef extern from *:
|
2549
2663
|
* cdef object __Pyx_PyBytes_FromStringAndSize(const char*, size_t)
|
@@ -2557,8 +2671,8 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(s
|
|
2557
2671
|
|
2558
2672
|
/* "string.to_py":43
|
2559
2673
|
*
|
2560
|
-
* @cname("
|
2561
|
-
* cdef inline object
|
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): # <<<<<<<<<<<<<<
|
2562
2676
|
* return __Pyx_PyStr_FromStringAndSize(s.data(), s.size())
|
2563
2677
|
* cdef extern from *:
|
2564
2678
|
*/
|
@@ -2566,7 +2680,7 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(s
|
|
2566
2680
|
/* function exit code */
|
2567
2681
|
__pyx_L1_error:;
|
2568
2682
|
__Pyx_XDECREF(__pyx_t_1);
|
2569
|
-
__Pyx_AddTraceback("string.to_py.
|
2683
|
+
__Pyx_AddTraceback("string.to_py.__pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
2570
2684
|
__pyx_r = 0;
|
2571
2685
|
__pyx_L0:;
|
2572
2686
|
__Pyx_XGIVEREF(__pyx_r);
|
@@ -2576,24 +2690,24 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(s
|
|
2576
2690
|
|
2577
2691
|
/* "string.to_py":49
|
2578
2692
|
*
|
2579
|
-
* @cname("
|
2580
|
-
* cdef inline object
|
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): # <<<<<<<<<<<<<<
|
2581
2695
|
* return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size())
|
2582
2696
|
* cdef extern from *:
|
2583
2697
|
*/
|
2584
2698
|
|
2585
|
-
static CYTHON_INLINE PyObject *
|
2699
|
+
static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(std::string const &__pyx_v_s) {
|
2586
2700
|
PyObject *__pyx_r = NULL;
|
2587
2701
|
__Pyx_RefNannyDeclarations
|
2588
2702
|
PyObject *__pyx_t_1 = NULL;
|
2589
2703
|
int __pyx_lineno = 0;
|
2590
2704
|
const char *__pyx_filename = NULL;
|
2591
2705
|
int __pyx_clineno = 0;
|
2592
|
-
__Pyx_RefNannySetupContext("
|
2706
|
+
__Pyx_RefNannySetupContext("__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string", 1);
|
2593
2707
|
|
2594
2708
|
/* "string.to_py":50
|
2595
|
-
* @cname("
|
2596
|
-
* cdef inline object
|
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):
|
2597
2711
|
* return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
|
2598
2712
|
* cdef extern from *:
|
2599
2713
|
* cdef object __Pyx_PyByteArray_FromStringAndSize(const char*, size_t)
|
@@ -2607,8 +2721,8 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string
|
|
2607
2721
|
|
2608
2722
|
/* "string.to_py":49
|
2609
2723
|
*
|
2610
|
-
* @cname("
|
2611
|
-
* cdef inline object
|
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): # <<<<<<<<<<<<<<
|
2612
2726
|
* return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size())
|
2613
2727
|
* cdef extern from *:
|
2614
2728
|
*/
|
@@ -2616,7 +2730,7 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string
|
|
2616
2730
|
/* function exit code */
|
2617
2731
|
__pyx_L1_error:;
|
2618
2732
|
__Pyx_XDECREF(__pyx_t_1);
|
2619
|
-
__Pyx_AddTraceback("string.to_py.
|
2733
|
+
__Pyx_AddTraceback("string.to_py.__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
2620
2734
|
__pyx_r = 0;
|
2621
2735
|
__pyx_L0:;
|
2622
2736
|
__Pyx_XGIVEREF(__pyx_r);
|
@@ -2626,24 +2740,24 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string
|
|
2626
2740
|
|
2627
2741
|
/* "string.to_py":55
|
2628
2742
|
*
|
2629
|
-
* @cname("
|
2630
|
-
* cdef inline object
|
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): # <<<<<<<<<<<<<<
|
2631
2745
|
* return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size())
|
2632
2746
|
*
|
2633
2747
|
*/
|
2634
2748
|
|
2635
|
-
static CYTHON_INLINE PyObject *
|
2749
|
+
static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string(std::string const &__pyx_v_s) {
|
2636
2750
|
PyObject *__pyx_r = NULL;
|
2637
2751
|
__Pyx_RefNannyDeclarations
|
2638
2752
|
PyObject *__pyx_t_1 = NULL;
|
2639
2753
|
int __pyx_lineno = 0;
|
2640
2754
|
const char *__pyx_filename = NULL;
|
2641
2755
|
int __pyx_clineno = 0;
|
2642
|
-
__Pyx_RefNannySetupContext("
|
2756
|
+
__Pyx_RefNannySetupContext("__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string", 1);
|
2643
2757
|
|
2644
2758
|
/* "string.to_py":56
|
2645
|
-
* @cname("
|
2646
|
-
* cdef inline object
|
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):
|
2647
2761
|
* return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
|
2648
2762
|
*
|
2649
2763
|
*/
|
@@ -2656,8 +2770,8 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_st
|
|
2656
2770
|
|
2657
2771
|
/* "string.to_py":55
|
2658
2772
|
*
|
2659
|
-
* @cname("
|
2660
|
-
* cdef inline object
|
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): # <<<<<<<<<<<<<<
|
2661
2775
|
* return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size())
|
2662
2776
|
*
|
2663
2777
|
*/
|
@@ -2665,7 +2779,7 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_st
|
|
2665
2779
|
/* function exit code */
|
2666
2780
|
__pyx_L1_error:;
|
2667
2781
|
__Pyx_XDECREF(__pyx_t_1);
|
2668
|
-
__Pyx_AddTraceback("string.to_py.
|
2782
|
+
__Pyx_AddTraceback("string.to_py.__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
2669
2783
|
__pyx_r = 0;
|
2670
2784
|
__pyx_L0:;
|
2671
2785
|
__Pyx_XGIVEREF(__pyx_r);
|
@@ -2675,27 +2789,25 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_st
|
|
2675
2789
|
|
2676
2790
|
/* "string.from_py":13
|
2677
2791
|
*
|
2678
|
-
* @cname("
|
2679
|
-
* cdef string
|
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 *: # <<<<<<<<<<<<<<
|
2680
2794
|
* cdef Py_ssize_t length = 0
|
2681
2795
|
* cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
|
2682
2796
|
*/
|
2683
2797
|
|
2684
|
-
static std::string
|
2798
|
+
static std::string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(PyObject *__pyx_v_o) {
|
2685
2799
|
Py_ssize_t __pyx_v_length;
|
2686
2800
|
char const *__pyx_v_data;
|
2687
2801
|
std::string __pyx_r;
|
2688
|
-
__Pyx_RefNannyDeclarations
|
2689
2802
|
char const *__pyx_t_1;
|
2690
2803
|
std::string __pyx_t_2;
|
2691
2804
|
int __pyx_lineno = 0;
|
2692
2805
|
const char *__pyx_filename = NULL;
|
2693
2806
|
int __pyx_clineno = 0;
|
2694
|
-
__Pyx_RefNannySetupContext("__pyx_convert_string_from_py_std__in_string", 0);
|
2695
2807
|
|
2696
2808
|
/* "string.from_py":14
|
2697
|
-
* @cname("
|
2698
|
-
* cdef string
|
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 *:
|
2699
2811
|
* cdef Py_ssize_t length = 0 # <<<<<<<<<<<<<<
|
2700
2812
|
* cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
|
2701
2813
|
* return string(data, length)
|
@@ -2703,7 +2815,7 @@ static std::string __pyx_convert_string_from_py_std__in_string(PyObject *__pyx_v
|
|
2703
2815
|
__pyx_v_length = 0;
|
2704
2816
|
|
2705
2817
|
/* "string.from_py":15
|
2706
|
-
* cdef string
|
2818
|
+
* cdef string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(object o) except *:
|
2707
2819
|
* cdef Py_ssize_t length = 0
|
2708
2820
|
* cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) # <<<<<<<<<<<<<<
|
2709
2821
|
* return string(data, length)
|
@@ -2730,22 +2842,21 @@ static std::string __pyx_convert_string_from_py_std__in_string(PyObject *__pyx_v
|
|
2730
2842
|
|
2731
2843
|
/* "string.from_py":13
|
2732
2844
|
*
|
2733
|
-
* @cname("
|
2734
|
-
* cdef string
|
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 *: # <<<<<<<<<<<<<<
|
2735
2847
|
* cdef Py_ssize_t length = 0
|
2736
2848
|
* cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
|
2737
2849
|
*/
|
2738
2850
|
|
2739
2851
|
/* function exit code */
|
2740
2852
|
__pyx_L1_error:;
|
2741
|
-
__Pyx_AddTraceback("string.from_py.
|
2853
|
+
__Pyx_AddTraceback("string.from_py.__pyx_convert_string_from_py_6libcpp_6string_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
2742
2854
|
__Pyx_pretend_to_initialize(&__pyx_r);
|
2743
2855
|
__pyx_L0:;
|
2744
|
-
__Pyx_RefNannyFinishContext();
|
2745
2856
|
return __pyx_r;
|
2746
2857
|
}
|
2747
2858
|
|
2748
|
-
/* "ulid_transform/_ulid_impl.pyx":
|
2859
|
+
/* "ulid_transform/_ulid_impl.pyx":17
|
2749
2860
|
*
|
2750
2861
|
*
|
2751
2862
|
* def _ulid_now() -> str: # <<<<<<<<<<<<<<
|
@@ -2776,9 +2887,9 @@ static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl__ulid_now(CYTHON_UNUSED
|
|
2776
2887
|
int __pyx_lineno = 0;
|
2777
2888
|
const char *__pyx_filename = NULL;
|
2778
2889
|
int __pyx_clineno = 0;
|
2779
|
-
__Pyx_RefNannySetupContext("_ulid_now",
|
2890
|
+
__Pyx_RefNannySetupContext("_ulid_now", 1);
|
2780
2891
|
|
2781
|
-
/* "ulid_transform/_ulid_impl.pyx":
|
2892
|
+
/* "ulid_transform/_ulid_impl.pyx":18
|
2782
2893
|
*
|
2783
2894
|
* def _ulid_now() -> str:
|
2784
2895
|
* return _cpp_ulid().decode("ascii") # <<<<<<<<<<<<<<
|
@@ -2786,13 +2897,13 @@ static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl__ulid_now(CYTHON_UNUSED
|
|
2786
2897
|
* def _ulid_at_time(_time: float) -> str:
|
2787
2898
|
*/
|
2788
2899
|
__Pyx_XDECREF(__pyx_r);
|
2789
|
-
__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,
|
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)
|
2790
2901
|
__Pyx_GOTREF(__pyx_t_1);
|
2791
2902
|
__pyx_r = ((PyObject*)__pyx_t_1);
|
2792
2903
|
__pyx_t_1 = 0;
|
2793
2904
|
goto __pyx_L0;
|
2794
2905
|
|
2795
|
-
/* "ulid_transform/_ulid_impl.pyx":
|
2906
|
+
/* "ulid_transform/_ulid_impl.pyx":17
|
2796
2907
|
*
|
2797
2908
|
*
|
2798
2909
|
* def _ulid_now() -> str: # <<<<<<<<<<<<<<
|
@@ -2811,7 +2922,7 @@ static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl__ulid_now(CYTHON_UNUSED
|
|
2811
2922
|
return __pyx_r;
|
2812
2923
|
}
|
2813
2924
|
|
2814
|
-
/* "ulid_transform/_ulid_impl.pyx":
|
2925
|
+
/* "ulid_transform/_ulid_impl.pyx":20
|
2815
2926
|
* return _cpp_ulid().decode("ascii")
|
2816
2927
|
*
|
2817
2928
|
* def _ulid_at_time(_time: float) -> str: # <<<<<<<<<<<<<<
|
@@ -2851,8 +2962,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
2851
2962
|
#if CYTHON_ASSUME_SAFE_MACROS
|
2852
2963
|
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
|
2853
2964
|
#else
|
2854
|
-
__pyx_nargs = PyTuple_Size(__pyx_args);
|
2855
|
-
if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 19, __pyx_L3_error)
|
2965
|
+
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
|
2856
2966
|
#endif
|
2857
2967
|
#endif
|
2858
2968
|
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
|
@@ -2873,24 +2983,25 @@ PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
2873
2983
|
(void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
|
2874
2984
|
kw_args--;
|
2875
2985
|
}
|
2876
|
-
else if (unlikely(PyErr_Occurred())) __PYX_ERR(0,
|
2986
|
+
else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 20, __pyx_L3_error)
|
2877
2987
|
else goto __pyx_L5_argtuple_error;
|
2878
2988
|
}
|
2879
2989
|
if (unlikely(kw_args > 0)) {
|
2880
2990
|
const Py_ssize_t kwd_pos_args = __pyx_nargs;
|
2881
|
-
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_ulid_at_time") < 0)) __PYX_ERR(0,
|
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)
|
2882
2992
|
}
|
2883
2993
|
} else if (unlikely(__pyx_nargs != 1)) {
|
2884
2994
|
goto __pyx_L5_argtuple_error;
|
2885
2995
|
} else {
|
2886
2996
|
values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
|
2887
2997
|
}
|
2888
|
-
__pyx_v__time = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v__time == (double)-1) && PyErr_Occurred())) __PYX_ERR(0,
|
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)
|
2889
2999
|
}
|
2890
|
-
goto
|
3000
|
+
goto __pyx_L6_skip;
|
2891
3001
|
__pyx_L5_argtuple_error:;
|
2892
|
-
__Pyx_RaiseArgtupleInvalid("_ulid_at_time", 1, 1, 1, __pyx_nargs); __PYX_ERR(0,
|
2893
|
-
|
3002
|
+
__Pyx_RaiseArgtupleInvalid("_ulid_at_time", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 20, __pyx_L3_error)
|
3003
|
+
__pyx_L6_skip:;
|
3004
|
+
goto __pyx_L4_argument_unpacking_done;
|
2894
3005
|
__pyx_L3_error:;
|
2895
3006
|
{
|
2896
3007
|
Py_ssize_t __pyx_temp;
|
@@ -2922,9 +3033,9 @@ static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl_2_ulid_at_time(CYTHON_UN
|
|
2922
3033
|
int __pyx_lineno = 0;
|
2923
3034
|
const char *__pyx_filename = NULL;
|
2924
3035
|
int __pyx_clineno = 0;
|
2925
|
-
__Pyx_RefNannySetupContext("_ulid_at_time",
|
3036
|
+
__Pyx_RefNannySetupContext("_ulid_at_time", 1);
|
2926
3037
|
|
2927
|
-
/* "ulid_transform/_ulid_impl.pyx":
|
3038
|
+
/* "ulid_transform/_ulid_impl.pyx":21
|
2928
3039
|
*
|
2929
3040
|
* def _ulid_at_time(_time: float) -> str:
|
2930
3041
|
* return _cpp_ulid_at_time(_time).decode("ascii") # <<<<<<<<<<<<<<
|
@@ -2932,13 +3043,13 @@ static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl_2_ulid_at_time(CYTHON_UN
|
|
2932
3043
|
* def _ulid_to_bytes(ulid_str: str) -> bytes:
|
2933
3044
|
*/
|
2934
3045
|
__Pyx_XDECREF(__pyx_r);
|
2935
|
-
__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,
|
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)
|
2936
3047
|
__Pyx_GOTREF(__pyx_t_1);
|
2937
3048
|
__pyx_r = ((PyObject*)__pyx_t_1);
|
2938
3049
|
__pyx_t_1 = 0;
|
2939
3050
|
goto __pyx_L0;
|
2940
3051
|
|
2941
|
-
/* "ulid_transform/_ulid_impl.pyx":
|
3052
|
+
/* "ulid_transform/_ulid_impl.pyx":20
|
2942
3053
|
* return _cpp_ulid().decode("ascii")
|
2943
3054
|
*
|
2944
3055
|
* def _ulid_at_time(_time: float) -> str: # <<<<<<<<<<<<<<
|
@@ -2957,7 +3068,7 @@ static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl_2_ulid_at_time(CYTHON_UN
|
|
2957
3068
|
return __pyx_r;
|
2958
3069
|
}
|
2959
3070
|
|
2960
|
-
/* "ulid_transform/_ulid_impl.pyx":
|
3071
|
+
/* "ulid_transform/_ulid_impl.pyx":23
|
2961
3072
|
* return _cpp_ulid_at_time(_time).decode("ascii")
|
2962
3073
|
*
|
2963
3074
|
* def _ulid_to_bytes(ulid_str: str) -> bytes: # <<<<<<<<<<<<<<
|
@@ -2997,8 +3108,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
2997
3108
|
#if CYTHON_ASSUME_SAFE_MACROS
|
2998
3109
|
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
|
2999
3110
|
#else
|
3000
|
-
__pyx_nargs = PyTuple_Size(__pyx_args);
|
3001
|
-
if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 22, __pyx_L3_error)
|
3111
|
+
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
|
3002
3112
|
#endif
|
3003
3113
|
#endif
|
3004
3114
|
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
|
@@ -3019,12 +3129,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
3019
3129
|
(void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
|
3020
3130
|
kw_args--;
|
3021
3131
|
}
|
3022
|
-
else if (unlikely(PyErr_Occurred())) __PYX_ERR(0,
|
3132
|
+
else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 23, __pyx_L3_error)
|
3023
3133
|
else goto __pyx_L5_argtuple_error;
|
3024
3134
|
}
|
3025
3135
|
if (unlikely(kw_args > 0)) {
|
3026
3136
|
const Py_ssize_t kwd_pos_args = __pyx_nargs;
|
3027
|
-
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_ulid_to_bytes") < 0)) __PYX_ERR(0,
|
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)
|
3028
3138
|
}
|
3029
3139
|
} else if (unlikely(__pyx_nargs != 1)) {
|
3030
3140
|
goto __pyx_L5_argtuple_error;
|
@@ -3033,10 +3143,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
3033
3143
|
}
|
3034
3144
|
__pyx_v_ulid_str = ((PyObject*)values[0]);
|
3035
3145
|
}
|
3036
|
-
goto
|
3146
|
+
goto __pyx_L6_skip;
|
3037
3147
|
__pyx_L5_argtuple_error:;
|
3038
|
-
__Pyx_RaiseArgtupleInvalid("_ulid_to_bytes", 1, 1, 1, __pyx_nargs); __PYX_ERR(0,
|
3039
|
-
|
3148
|
+
__Pyx_RaiseArgtupleInvalid("_ulid_to_bytes", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 23, __pyx_L3_error)
|
3149
|
+
__pyx_L6_skip:;
|
3150
|
+
goto __pyx_L4_argument_unpacking_done;
|
3040
3151
|
__pyx_L3_error:;
|
3041
3152
|
{
|
3042
3153
|
Py_ssize_t __pyx_temp;
|
@@ -3048,7 +3159,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
3048
3159
|
__Pyx_RefNannyFinishContext();
|
3049
3160
|
return NULL;
|
3050
3161
|
__pyx_L4_argument_unpacking_done:;
|
3051
|
-
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ulid_str), (&PyUnicode_Type), 0, "ulid_str", 1))) __PYX_ERR(0,
|
3162
|
+
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ulid_str), (&PyUnicode_Type), 0, "ulid_str", 1))) __PYX_ERR(0, 23, __pyx_L1_error)
|
3052
3163
|
__pyx_r = __pyx_pf_14ulid_transform_10_ulid_impl_4_ulid_to_bytes(__pyx_self, __pyx_v_ulid_str);
|
3053
3164
|
|
3054
3165
|
/* function exit code */
|
@@ -3077,36 +3188,36 @@ static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl_4_ulid_to_bytes(CYTHON_U
|
|
3077
3188
|
int __pyx_lineno = 0;
|
3078
3189
|
const char *__pyx_filename = NULL;
|
3079
3190
|
int __pyx_clineno = 0;
|
3080
|
-
__Pyx_RefNannySetupContext("_ulid_to_bytes",
|
3191
|
+
__Pyx_RefNannySetupContext("_ulid_to_bytes", 1);
|
3081
3192
|
|
3082
|
-
/* "ulid_transform/_ulid_impl.pyx":
|
3193
|
+
/* "ulid_transform/_ulid_impl.pyx":24
|
3083
3194
|
*
|
3084
3195
|
* def _ulid_to_bytes(ulid_str: str) -> bytes:
|
3085
3196
|
* if len(ulid_str) != 26: # <<<<<<<<<<<<<<
|
3086
3197
|
* raise ValueError(f"ULID must be a 26 character string: {ulid_str}")
|
3087
3198
|
* return _cpp_ulid_to_bytes(ulid_str.encode("ascii"))
|
3088
3199
|
*/
|
3089
|
-
__pyx_t_1 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_ulid_str); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0,
|
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)
|
3090
3201
|
__pyx_t_2 = (__pyx_t_1 != 26);
|
3091
3202
|
if (unlikely(__pyx_t_2)) {
|
3092
3203
|
|
3093
|
-
/* "ulid_transform/_ulid_impl.pyx":
|
3204
|
+
/* "ulid_transform/_ulid_impl.pyx":25
|
3094
3205
|
* def _ulid_to_bytes(ulid_str: str) -> bytes:
|
3095
3206
|
* if len(ulid_str) != 26:
|
3096
3207
|
* raise ValueError(f"ULID must be a 26 character string: {ulid_str}") # <<<<<<<<<<<<<<
|
3097
3208
|
* return _cpp_ulid_to_bytes(ulid_str.encode("ascii"))
|
3098
3209
|
*
|
3099
3210
|
*/
|
3100
|
-
__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,
|
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)
|
3101
3212
|
__Pyx_GOTREF(__pyx_t_3);
|
3102
|
-
__pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0,
|
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)
|
3103
3214
|
__Pyx_GOTREF(__pyx_t_4);
|
3104
3215
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
3105
3216
|
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
|
3106
3217
|
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
3107
|
-
__PYX_ERR(0,
|
3218
|
+
__PYX_ERR(0, 25, __pyx_L1_error)
|
3108
3219
|
|
3109
|
-
/* "ulid_transform/_ulid_impl.pyx":
|
3220
|
+
/* "ulid_transform/_ulid_impl.pyx":24
|
3110
3221
|
*
|
3111
3222
|
* def _ulid_to_bytes(ulid_str: str) -> bytes:
|
3112
3223
|
* if len(ulid_str) != 26: # <<<<<<<<<<<<<<
|
@@ -3115,7 +3226,7 @@ static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl_4_ulid_to_bytes(CYTHON_U
|
|
3115
3226
|
*/
|
3116
3227
|
}
|
3117
3228
|
|
3118
|
-
/* "ulid_transform/_ulid_impl.pyx":
|
3229
|
+
/* "ulid_transform/_ulid_impl.pyx":26
|
3119
3230
|
* if len(ulid_str) != 26:
|
3120
3231
|
* raise ValueError(f"ULID must be a 26 character string: {ulid_str}")
|
3121
3232
|
* return _cpp_ulid_to_bytes(ulid_str.encode("ascii")) # <<<<<<<<<<<<<<
|
@@ -3123,17 +3234,17 @@ static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl_4_ulid_to_bytes(CYTHON_U
|
|
3123
3234
|
* def _bytes_to_ulid(ulid_bytes: bytes) -> str:
|
3124
3235
|
*/
|
3125
3236
|
__Pyx_XDECREF(__pyx_r);
|
3126
|
-
__pyx_t_4 = PyUnicode_AsASCIIString(__pyx_v_ulid_str); if (unlikely(!__pyx_t_4)) __PYX_ERR(0,
|
3237
|
+
__pyx_t_4 = PyUnicode_AsASCIIString(__pyx_v_ulid_str); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 26, __pyx_L1_error)
|
3127
3238
|
__Pyx_GOTREF(__pyx_t_4);
|
3128
|
-
__pyx_t_5 = __Pyx_PyBytes_AsString(__pyx_t_4); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0,
|
3129
|
-
__pyx_t_3 =
|
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)
|
3130
3241
|
__Pyx_GOTREF(__pyx_t_3);
|
3131
3242
|
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
3132
3243
|
__pyx_r = ((PyObject*)__pyx_t_3);
|
3133
3244
|
__pyx_t_3 = 0;
|
3134
3245
|
goto __pyx_L0;
|
3135
3246
|
|
3136
|
-
/* "ulid_transform/_ulid_impl.pyx":
|
3247
|
+
/* "ulid_transform/_ulid_impl.pyx":23
|
3137
3248
|
* return _cpp_ulid_at_time(_time).decode("ascii")
|
3138
3249
|
*
|
3139
3250
|
* def _ulid_to_bytes(ulid_str: str) -> bytes: # <<<<<<<<<<<<<<
|
@@ -3153,7 +3264,7 @@ static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl_4_ulid_to_bytes(CYTHON_U
|
|
3153
3264
|
return __pyx_r;
|
3154
3265
|
}
|
3155
3266
|
|
3156
|
-
/* "ulid_transform/_ulid_impl.pyx":
|
3267
|
+
/* "ulid_transform/_ulid_impl.pyx":28
|
3157
3268
|
* return _cpp_ulid_to_bytes(ulid_str.encode("ascii"))
|
3158
3269
|
*
|
3159
3270
|
* def _bytes_to_ulid(ulid_bytes: bytes) -> str: # <<<<<<<<<<<<<<
|
@@ -3193,8 +3304,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
3193
3304
|
#if CYTHON_ASSUME_SAFE_MACROS
|
3194
3305
|
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
|
3195
3306
|
#else
|
3196
|
-
__pyx_nargs = PyTuple_Size(__pyx_args);
|
3197
|
-
if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 27, __pyx_L3_error)
|
3307
|
+
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
|
3198
3308
|
#endif
|
3199
3309
|
#endif
|
3200
3310
|
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
|
@@ -3215,12 +3325,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
3215
3325
|
(void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
|
3216
3326
|
kw_args--;
|
3217
3327
|
}
|
3218
|
-
else if (unlikely(PyErr_Occurred())) __PYX_ERR(0,
|
3328
|
+
else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 28, __pyx_L3_error)
|
3219
3329
|
else goto __pyx_L5_argtuple_error;
|
3220
3330
|
}
|
3221
3331
|
if (unlikely(kw_args > 0)) {
|
3222
3332
|
const Py_ssize_t kwd_pos_args = __pyx_nargs;
|
3223
|
-
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_bytes_to_ulid") < 0)) __PYX_ERR(0,
|
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)
|
3224
3334
|
}
|
3225
3335
|
} else if (unlikely(__pyx_nargs != 1)) {
|
3226
3336
|
goto __pyx_L5_argtuple_error;
|
@@ -3229,10 +3339,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
3229
3339
|
}
|
3230
3340
|
__pyx_v_ulid_bytes = ((PyObject*)values[0]);
|
3231
3341
|
}
|
3232
|
-
goto
|
3342
|
+
goto __pyx_L6_skip;
|
3233
3343
|
__pyx_L5_argtuple_error:;
|
3234
|
-
__Pyx_RaiseArgtupleInvalid("_bytes_to_ulid", 1, 1, 1, __pyx_nargs); __PYX_ERR(0,
|
3235
|
-
|
3344
|
+
__Pyx_RaiseArgtupleInvalid("_bytes_to_ulid", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 28, __pyx_L3_error)
|
3345
|
+
__pyx_L6_skip:;
|
3346
|
+
goto __pyx_L4_argument_unpacking_done;
|
3236
3347
|
__pyx_L3_error:;
|
3237
3348
|
{
|
3238
3349
|
Py_ssize_t __pyx_temp;
|
@@ -3244,7 +3355,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
3244
3355
|
__Pyx_RefNannyFinishContext();
|
3245
3356
|
return NULL;
|
3246
3357
|
__pyx_L4_argument_unpacking_done:;
|
3247
|
-
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ulid_bytes), (&PyBytes_Type), 0, "ulid_bytes", 1))) __PYX_ERR(0,
|
3358
|
+
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ulid_bytes), (&PyBytes_Type), 0, "ulid_bytes", 1))) __PYX_ERR(0, 28, __pyx_L1_error)
|
3248
3359
|
__pyx_r = __pyx_pf_14ulid_transform_10_ulid_impl_6_bytes_to_ulid(__pyx_self, __pyx_v_ulid_bytes);
|
3249
3360
|
|
3250
3361
|
/* function exit code */
|
@@ -3273,38 +3384,39 @@ static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl_6_bytes_to_ulid(CYTHON_U
|
|
3273
3384
|
int __pyx_lineno = 0;
|
3274
3385
|
const char *__pyx_filename = NULL;
|
3275
3386
|
int __pyx_clineno = 0;
|
3276
|
-
__Pyx_RefNannySetupContext("_bytes_to_ulid",
|
3387
|
+
__Pyx_RefNannySetupContext("_bytes_to_ulid", 1);
|
3277
3388
|
|
3278
|
-
/* "ulid_transform/_ulid_impl.pyx":
|
3389
|
+
/* "ulid_transform/_ulid_impl.pyx":29
|
3279
3390
|
*
|
3280
3391
|
* def _bytes_to_ulid(ulid_bytes: bytes) -> str:
|
3281
3392
|
* if len(ulid_bytes) != 16: # <<<<<<<<<<<<<<
|
3282
3393
|
* raise ValueError(f"ULID bytes be 16 bytes: {ulid_bytes}")
|
3283
3394
|
* return _cpp_bytes_to_ulid(ulid_bytes).decode("ascii")
|
3284
3395
|
*/
|
3285
|
-
__pyx_t_1 = __Pyx_PyBytes_GET_SIZE(__pyx_v_ulid_bytes); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0,
|
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)
|
3286
3397
|
__pyx_t_2 = (__pyx_t_1 != 16);
|
3287
3398
|
if (unlikely(__pyx_t_2)) {
|
3288
3399
|
|
3289
|
-
/* "ulid_transform/_ulid_impl.pyx":
|
3400
|
+
/* "ulid_transform/_ulid_impl.pyx":30
|
3290
3401
|
* def _bytes_to_ulid(ulid_bytes: bytes) -> str:
|
3291
3402
|
* if len(ulid_bytes) != 16:
|
3292
3403
|
* raise ValueError(f"ULID bytes be 16 bytes: {ulid_bytes}") # <<<<<<<<<<<<<<
|
3293
3404
|
* return _cpp_bytes_to_ulid(ulid_bytes).decode("ascii")
|
3405
|
+
*
|
3294
3406
|
*/
|
3295
|
-
__pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_v_ulid_bytes, __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0,
|
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)
|
3296
3408
|
__Pyx_GOTREF(__pyx_t_3);
|
3297
|
-
__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,
|
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)
|
3298
3410
|
__Pyx_GOTREF(__pyx_t_4);
|
3299
3411
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
3300
|
-
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0,
|
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)
|
3301
3413
|
__Pyx_GOTREF(__pyx_t_3);
|
3302
3414
|
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
3303
3415
|
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
|
3304
3416
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
3305
|
-
__PYX_ERR(0,
|
3417
|
+
__PYX_ERR(0, 30, __pyx_L1_error)
|
3306
3418
|
|
3307
|
-
/* "ulid_transform/_ulid_impl.pyx":
|
3419
|
+
/* "ulid_transform/_ulid_impl.pyx":29
|
3308
3420
|
*
|
3309
3421
|
* def _bytes_to_ulid(ulid_bytes: bytes) -> str:
|
3310
3422
|
* if len(ulid_bytes) != 16: # <<<<<<<<<<<<<<
|
@@ -3313,20 +3425,22 @@ static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl_6_bytes_to_ulid(CYTHON_U
|
|
3313
3425
|
*/
|
3314
3426
|
}
|
3315
3427
|
|
3316
|
-
/* "ulid_transform/_ulid_impl.pyx":
|
3428
|
+
/* "ulid_transform/_ulid_impl.pyx":31
|
3317
3429
|
* if len(ulid_bytes) != 16:
|
3318
3430
|
* raise ValueError(f"ULID bytes be 16 bytes: {ulid_bytes}")
|
3319
3431
|
* return _cpp_bytes_to_ulid(ulid_bytes).decode("ascii") # <<<<<<<<<<<<<<
|
3432
|
+
*
|
3433
|
+
* def _ulid_to_bytes_or_none(ulid_str: Optional[str]) -> Optional[bytes]:
|
3320
3434
|
*/
|
3321
3435
|
__Pyx_XDECREF(__pyx_r);
|
3322
|
-
__pyx_t_5 =
|
3323
|
-
__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,
|
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)
|
3324
3438
|
__Pyx_GOTREF(__pyx_t_3);
|
3325
3439
|
__pyx_r = ((PyObject*)__pyx_t_3);
|
3326
3440
|
__pyx_t_3 = 0;
|
3327
3441
|
goto __pyx_L0;
|
3328
3442
|
|
3329
|
-
/* "ulid_transform/_ulid_impl.pyx":
|
3443
|
+
/* "ulid_transform/_ulid_impl.pyx":28
|
3330
3444
|
* return _cpp_ulid_to_bytes(ulid_str.encode("ascii"))
|
3331
3445
|
*
|
3332
3446
|
* def _bytes_to_ulid(ulid_bytes: bytes) -> str: # <<<<<<<<<<<<<<
|
@@ -3346,6 +3460,410 @@ static PyObject *__pyx_pf_14ulid_transform_10_ulid_impl_6_bytes_to_ulid(CYTHON_U
|
|
3346
3460
|
return __pyx_r;
|
3347
3461
|
}
|
3348
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
|
+
|
3349
3867
|
static PyMethodDef __pyx_methods[] = {
|
3350
3868
|
{0, 0, 0, 0}
|
3351
3869
|
};
|
@@ -3363,13 +3881,17 @@ static PyMethodDef __pyx_methods[] = {
|
|
3363
3881
|
static int __Pyx_CreateStringTabAndInitStrings(void) {
|
3364
3882
|
__Pyx_StringTabEntry __pyx_string_tab[] = {
|
3365
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},
|
3366
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},
|
3367
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},
|
3368
3889
|
{&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
|
3369
|
-
{&
|
3890
|
+
{&__pyx_n_s__11, __pyx_k__11, sizeof(__pyx_k__11), 0, 0, 1, 1},
|
3370
3891
|
{&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1},
|
3371
3892
|
{&__pyx_n_s_bytes, __pyx_k_bytes, sizeof(__pyx_k_bytes), 0, 0, 1, 1},
|
3372
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},
|
3373
3895
|
{&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
|
3374
3896
|
{&__pyx_n_s_float, __pyx_k_float, sizeof(__pyx_k_float), 0, 0, 1, 1},
|
3375
3897
|
{&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
|
@@ -3382,11 +3904,13 @@ static int __Pyx_CreateStringTabAndInitStrings(void) {
|
|
3382
3904
|
{&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
|
3383
3905
|
{&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1},
|
3384
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},
|
3385
3908
|
{&__pyx_n_s_ulid_at_time, __pyx_k_ulid_at_time, sizeof(__pyx_k_ulid_at_time), 0, 0, 1, 1},
|
3386
3909
|
{&__pyx_n_s_ulid_bytes, __pyx_k_ulid_bytes, sizeof(__pyx_k_ulid_bytes), 0, 0, 1, 1},
|
3387
3910
|
{&__pyx_n_s_ulid_now, __pyx_k_ulid_now, sizeof(__pyx_k_ulid_now), 0, 0, 1, 1},
|
3388
3911
|
{&__pyx_n_s_ulid_str, __pyx_k_ulid_str, sizeof(__pyx_k_ulid_str), 0, 0, 1, 1},
|
3389
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},
|
3390
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},
|
3391
3915
|
{0, 0, 0, 0, 0, 0, 0}
|
3392
3916
|
};
|
@@ -3394,7 +3918,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) {
|
|
3394
3918
|
}
|
3395
3919
|
/* #### Code section: cached_builtins ### */
|
3396
3920
|
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
|
3397
|
-
__pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0,
|
3921
|
+
__pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 25, __pyx_L1_error)
|
3398
3922
|
return 0;
|
3399
3923
|
__pyx_L1_error:;
|
3400
3924
|
return -1;
|
@@ -3405,50 +3929,68 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
|
|
3405
3929
|
__Pyx_RefNannyDeclarations
|
3406
3930
|
__Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
|
3407
3931
|
|
3408
|
-
/* "ulid_transform/_ulid_impl.pyx":
|
3932
|
+
/* "ulid_transform/_ulid_impl.pyx":17
|
3409
3933
|
*
|
3410
3934
|
*
|
3411
3935
|
* def _ulid_now() -> str: # <<<<<<<<<<<<<<
|
3412
3936
|
* return _cpp_ulid().decode("ascii")
|
3413
3937
|
*
|
3414
3938
|
*/
|
3415
|
-
__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,
|
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)
|
3416
3940
|
|
3417
|
-
/* "ulid_transform/_ulid_impl.pyx":
|
3941
|
+
/* "ulid_transform/_ulid_impl.pyx":20
|
3418
3942
|
* return _cpp_ulid().decode("ascii")
|
3419
3943
|
*
|
3420
3944
|
* def _ulid_at_time(_time: float) -> str: # <<<<<<<<<<<<<<
|
3421
3945
|
* return _cpp_ulid_at_time(_time).decode("ascii")
|
3422
3946
|
*
|
3423
3947
|
*/
|
3424
|
-
__pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_time); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0,
|
3948
|
+
__pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_time); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 20, __pyx_L1_error)
|
3425
3949
|
__Pyx_GOTREF(__pyx_tuple__3);
|
3426
3950
|
__Pyx_GIVEREF(__pyx_tuple__3);
|
3427
|
-
__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,
|
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)
|
3428
3952
|
|
3429
|
-
/* "ulid_transform/_ulid_impl.pyx":
|
3953
|
+
/* "ulid_transform/_ulid_impl.pyx":23
|
3430
3954
|
* return _cpp_ulid_at_time(_time).decode("ascii")
|
3431
3955
|
*
|
3432
3956
|
* def _ulid_to_bytes(ulid_str: str) -> bytes: # <<<<<<<<<<<<<<
|
3433
3957
|
* if len(ulid_str) != 26:
|
3434
3958
|
* raise ValueError(f"ULID must be a 26 character string: {ulid_str}")
|
3435
3959
|
*/
|
3436
|
-
__pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_ulid_str); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0,
|
3960
|
+
__pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_ulid_str); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 23, __pyx_L1_error)
|
3437
3961
|
__Pyx_GOTREF(__pyx_tuple__5);
|
3438
3962
|
__Pyx_GIVEREF(__pyx_tuple__5);
|
3439
|
-
__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,
|
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)
|
3440
3964
|
|
3441
|
-
/* "ulid_transform/_ulid_impl.pyx":
|
3965
|
+
/* "ulid_transform/_ulid_impl.pyx":28
|
3442
3966
|
* return _cpp_ulid_to_bytes(ulid_str.encode("ascii"))
|
3443
3967
|
*
|
3444
3968
|
* def _bytes_to_ulid(ulid_bytes: bytes) -> str: # <<<<<<<<<<<<<<
|
3445
3969
|
* if len(ulid_bytes) != 16:
|
3446
3970
|
* raise ValueError(f"ULID bytes be 16 bytes: {ulid_bytes}")
|
3447
3971
|
*/
|
3448
|
-
__pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_ulid_bytes); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0,
|
3972
|
+
__pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_ulid_bytes); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 28, __pyx_L1_error)
|
3449
3973
|
__Pyx_GOTREF(__pyx_tuple__7);
|
3450
3974
|
__Pyx_GIVEREF(__pyx_tuple__7);
|
3451
|
-
__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,
|
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)
|
3452
3994
|
__Pyx_RefNannyFinishContext();
|
3453
3995
|
return 0;
|
3454
3996
|
__pyx_L1_error:;
|
@@ -3723,7 +4265,7 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec__ulid_impl(PyObject *__pyx_pyinit_
|
|
3723
4265
|
__pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
|
3724
4266
|
{
|
3725
4267
|
int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef);
|
3726
|
-
__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 */
|
3727
4269
|
if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
|
3728
4270
|
pystate_addmodule_run = 1;
|
3729
4271
|
}
|
@@ -3735,10 +4277,8 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec__ulid_impl(PyObject *__pyx_pyinit_
|
|
3735
4277
|
CYTHON_UNUSED_VAR(__pyx_t_1);
|
3736
4278
|
__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
|
3737
4279
|
Py_INCREF(__pyx_d);
|
3738
|
-
__pyx_b =
|
3739
|
-
|
3740
|
-
__pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
|
3741
|
-
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)
|
3742
4282
|
if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
|
3743
4283
|
#if CYTHON_REFNANNY
|
3744
4284
|
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
|
@@ -3750,7 +4290,7 @@ if (!__Pyx_RefNanny) {
|
|
3750
4290
|
}
|
3751
4291
|
#endif
|
3752
4292
|
__Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__ulid_impl(void)", 0);
|
3753
|
-
if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
|
4293
|
+
if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
|
3754
4294
|
#ifdef __Pxy_PyFrame_Initialize_Offsets
|
3755
4295
|
__Pxy_PyFrame_Initialize_Offsets();
|
3756
4296
|
#endif
|
@@ -3819,8 +4359,8 @@ if (!__Pyx_RefNanny) {
|
|
3819
4359
|
* from libcpp.string cimport string
|
3820
4360
|
*
|
3821
4361
|
* from time import time # <<<<<<<<<<<<<<
|
4362
|
+
* from typing import Optional
|
3822
4363
|
*
|
3823
|
-
* import cython
|
3824
4364
|
*/
|
3825
4365
|
__pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error)
|
3826
4366
|
__Pyx_GOTREF(__pyx_t_2);
|
@@ -3836,86 +4376,143 @@ if (!__Pyx_RefNanny) {
|
|
3836
4376
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
3837
4377
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
3838
4378
|
|
3839
|
-
/* "ulid_transform/_ulid_impl.pyx":
|
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
|
3840
4401
|
*
|
3841
4402
|
*
|
3842
4403
|
* def _ulid_now() -> str: # <<<<<<<<<<<<<<
|
3843
4404
|
* return _cpp_ulid().decode("ascii")
|
3844
4405
|
*
|
3845
4406
|
*/
|
3846
|
-
|
3847
|
-
__Pyx_GOTREF(__pyx_t_3);
|
3848
|
-
if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
|
3849
|
-
__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)
|
3850
4408
|
__Pyx_GOTREF(__pyx_t_2);
|
3851
|
-
|
3852
|
-
|
3853
|
-
|
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);
|
3854
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;
|
3855
4416
|
|
3856
|
-
/* "ulid_transform/_ulid_impl.pyx":
|
4417
|
+
/* "ulid_transform/_ulid_impl.pyx":20
|
3857
4418
|
* return _cpp_ulid().decode("ascii")
|
3858
4419
|
*
|
3859
4420
|
* def _ulid_at_time(_time: float) -> str: # <<<<<<<<<<<<<<
|
3860
4421
|
* return _cpp_ulid_at_time(_time).decode("ascii")
|
3861
4422
|
*
|
3862
4423
|
*/
|
3863
|
-
|
3864
|
-
__Pyx_GOTREF(__pyx_t_2);
|
3865
|
-
if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_time, __pyx_n_s_float) < 0) __PYX_ERR(0, 19, __pyx_L1_error)
|
3866
|
-
if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 19, __pyx_L1_error)
|
3867
|
-
__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)
|
3868
4425
|
__Pyx_GOTREF(__pyx_t_3);
|
3869
|
-
|
3870
|
-
|
3871
|
-
|
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);
|
3872
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;
|
3873
4434
|
|
3874
|
-
/* "ulid_transform/_ulid_impl.pyx":
|
4435
|
+
/* "ulid_transform/_ulid_impl.pyx":23
|
3875
4436
|
* return _cpp_ulid_at_time(_time).decode("ascii")
|
3876
4437
|
*
|
3877
4438
|
* def _ulid_to_bytes(ulid_str: str) -> bytes: # <<<<<<<<<<<<<<
|
3878
4439
|
* if len(ulid_str) != 26:
|
3879
4440
|
* raise ValueError(f"ULID must be a 26 character string: {ulid_str}")
|
3880
4441
|
*/
|
3881
|
-
|
3882
|
-
__Pyx_GOTREF(__pyx_t_3);
|
3883
|
-
if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_ulid_str, __pyx_n_s_str) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
|
3884
|
-
if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_bytes) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
|
3885
|
-
__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)
|
3886
4443
|
__Pyx_GOTREF(__pyx_t_2);
|
3887
|
-
|
3888
|
-
|
3889
|
-
|
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);
|
3890
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;
|
3891
4452
|
|
3892
|
-
/* "ulid_transform/_ulid_impl.pyx":
|
4453
|
+
/* "ulid_transform/_ulid_impl.pyx":28
|
3893
4454
|
* return _cpp_ulid_to_bytes(ulid_str.encode("ascii"))
|
3894
4455
|
*
|
3895
4456
|
* def _bytes_to_ulid(ulid_bytes: bytes) -> str: # <<<<<<<<<<<<<<
|
3896
4457
|
* if len(ulid_bytes) != 16:
|
3897
4458
|
* raise ValueError(f"ULID bytes be 16 bytes: {ulid_bytes}")
|
3898
4459
|
*/
|
3899
|
-
|
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)
|
3900
4465
|
__Pyx_GOTREF(__pyx_t_2);
|
3901
|
-
|
3902
|
-
|
3903
|
-
|
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)
|
4479
|
+
__Pyx_GOTREF(__pyx_t_2);
|
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)
|
3904
4483
|
__Pyx_GOTREF(__pyx_t_3);
|
3905
4484
|
__Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2);
|
3906
4485
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
3907
|
-
if (PyDict_SetItem(__pyx_d,
|
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)
|
4487
|
+
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
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);
|
3908
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;
|
3909
4506
|
|
3910
4507
|
/* "ulid_transform/_ulid_impl.pyx":1
|
3911
4508
|
* # distutils: language = c++ # <<<<<<<<<<<<<<
|
3912
4509
|
* from libcpp.string cimport string
|
3913
4510
|
*
|
3914
4511
|
*/
|
3915
|
-
|
3916
|
-
__Pyx_GOTREF(
|
3917
|
-
if (PyDict_SetItem(__pyx_d, __pyx_n_s_test,
|
3918
|
-
__Pyx_DECREF(
|
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;
|
3919
4516
|
|
3920
4517
|
/*--- Wrapped vars code ---*/
|
3921
4518
|
|
@@ -4044,6 +4641,8 @@ static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObjec
|
|
4044
4641
|
tmp_value = tstate->current_exception;
|
4045
4642
|
tstate->current_exception = value;
|
4046
4643
|
Py_XDECREF(tmp_value);
|
4644
|
+
Py_XDECREF(type);
|
4645
|
+
Py_XDECREF(tb);
|
4047
4646
|
#else
|
4048
4647
|
PyObject *tmp_type, *tmp_value, *tmp_tb;
|
4049
4648
|
tmp_type = tstate->curexc_type;
|
@@ -4101,14 +4700,20 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject
|
|
4101
4700
|
#endif
|
4102
4701
|
|
4103
4702
|
/* PyObjectGetAttrStrNoError */
|
4703
|
+
#if __PYX_LIMITED_VERSION_HEX < 0x030d00A1
|
4104
4704
|
static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
|
4105
4705
|
__Pyx_PyThreadState_declare
|
4106
4706
|
__Pyx_PyThreadState_assign
|
4107
4707
|
if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
|
4108
4708
|
__Pyx_PyErr_Clear();
|
4109
4709
|
}
|
4710
|
+
#endif
|
4110
4711
|
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
|
4111
4712
|
PyObject *result;
|
4713
|
+
#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
|
4714
|
+
(void) PyObject_GetOptionalAttr(obj, attr_name, &result);
|
4715
|
+
return result;
|
4716
|
+
#else
|
4112
4717
|
#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
|
4113
4718
|
PyTypeObject* tp = Py_TYPE(obj);
|
4114
4719
|
if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
|
@@ -4120,6 +4725,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, P
|
|
4120
4725
|
__Pyx_PyObject_GetAttrStr_ClearAttributeError();
|
4121
4726
|
}
|
4122
4727
|
return result;
|
4728
|
+
#endif
|
4123
4729
|
}
|
4124
4730
|
|
4125
4731
|
/* GetBuiltinName */
|
@@ -4335,13 +4941,31 @@ static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyO
|
|
4335
4941
|
{
|
4336
4942
|
int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ);
|
4337
4943
|
if (unlikely(eq != 0)) {
|
4338
|
-
if (unlikely(eq < 0)) return NULL;
|
4944
|
+
if (unlikely(eq < 0)) return NULL;
|
4339
4945
|
return kwvalues[i];
|
4340
4946
|
}
|
4341
4947
|
}
|
4342
|
-
return NULL;
|
4948
|
+
return NULL;
|
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;
|
4343
4966
|
}
|
4344
4967
|
#endif
|
4968
|
+
#endif
|
4345
4969
|
|
4346
4970
|
/* decode_c_bytes */
|
4347
4971
|
static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
|
@@ -4435,7 +5059,7 @@ static int __Pyx_ParseOptionalKeywords(
|
|
4435
5059
|
if (*name) {
|
4436
5060
|
values[name-argnames] = value;
|
4437
5061
|
#if CYTHON_AVOID_BORROWED_REFS
|
4438
|
-
Py_INCREF(value);
|
5062
|
+
Py_INCREF(value);
|
4439
5063
|
Py_DECREF(key);
|
4440
5064
|
#endif
|
4441
5065
|
key = NULL;
|
@@ -4454,7 +5078,7 @@ static int __Pyx_ParseOptionalKeywords(
|
|
4454
5078
|
&& _PyString_Eq(**name, key)) {
|
4455
5079
|
values[name-argnames] = value;
|
4456
5080
|
#if CYTHON_AVOID_BORROWED_REFS
|
4457
|
-
value = NULL;
|
5081
|
+
value = NULL;
|
4458
5082
|
#endif
|
4459
5083
|
break;
|
4460
5084
|
}
|
@@ -4486,7 +5110,7 @@ static int __Pyx_ParseOptionalKeywords(
|
|
4486
5110
|
if (cmp == 0) {
|
4487
5111
|
values[name-argnames] = value;
|
4488
5112
|
#if CYTHON_AVOID_BORROWED_REFS
|
4489
|
-
value = NULL;
|
5113
|
+
value = NULL;
|
4490
5114
|
#endif
|
4491
5115
|
break;
|
4492
5116
|
}
|
@@ -4638,9 +5262,15 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
|
|
4638
5262
|
PyObject *result;
|
4639
5263
|
assert(kwargs == NULL || PyDict_Check(kwargs));
|
4640
5264
|
nk = kwargs ? PyDict_Size(kwargs) : 0;
|
5265
|
+
#if PY_MAJOR_VERSION < 3
|
4641
5266
|
if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) {
|
4642
5267
|
return NULL;
|
4643
5268
|
}
|
5269
|
+
#else
|
5270
|
+
if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) {
|
5271
|
+
return NULL;
|
5272
|
+
}
|
5273
|
+
#endif
|
4644
5274
|
if (
|
4645
5275
|
#if PY_MAJOR_VERSION >= 3
|
4646
5276
|
co->co_kwonlyargcount == 0 &&
|
@@ -4717,8 +5347,13 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg
|
|
4717
5347
|
ternaryfunc call = Py_TYPE(func)->tp_call;
|
4718
5348
|
if (unlikely(!call))
|
4719
5349
|
return PyObject_Call(func, arg, kw);
|
5350
|
+
#if PY_MAJOR_VERSION < 3
|
4720
5351
|
if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
|
4721
5352
|
return NULL;
|
5353
|
+
#else
|
5354
|
+
if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
|
5355
|
+
return NULL;
|
5356
|
+
#endif
|
4722
5357
|
result = (*call)(func, arg, kw);
|
4723
5358
|
Py_LeaveRecursiveCall();
|
4724
5359
|
if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
|
@@ -4735,10 +5370,15 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg
|
|
4735
5370
|
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
|
4736
5371
|
PyObject *self, *result;
|
4737
5372
|
PyCFunction cfunc;
|
4738
|
-
cfunc =
|
4739
|
-
self =
|
5373
|
+
cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
|
5374
|
+
self = __Pyx_CyOrPyCFunction_GET_SELF(func);
|
5375
|
+
#if PY_MAJOR_VERSION < 3
|
4740
5376
|
if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
|
4741
5377
|
return NULL;
|
5378
|
+
#else
|
5379
|
+
if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
|
5380
|
+
return NULL;
|
5381
|
+
#endif
|
4742
5382
|
result = cfunc(self, arg);
|
4743
5383
|
Py_LeaveRecursiveCall();
|
4744
5384
|
if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
|
@@ -4751,6 +5391,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject
|
|
4751
5391
|
#endif
|
4752
5392
|
|
4753
5393
|
/* PyObjectFastCall */
|
5394
|
+
#if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API
|
4754
5395
|
static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) {
|
4755
5396
|
PyObject *argstuple;
|
4756
5397
|
PyObject *result = 0;
|
@@ -4766,28 +5407,17 @@ static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **arg
|
|
4766
5407
|
Py_DECREF(argstuple);
|
4767
5408
|
return result;
|
4768
5409
|
}
|
5410
|
+
#endif
|
4769
5411
|
static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) {
|
4770
5412
|
Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs);
|
4771
5413
|
#if CYTHON_COMPILING_IN_CPYTHON
|
4772
5414
|
if (nargs == 0 && kwargs == NULL) {
|
4773
|
-
|
4774
|
-
|
4775
|
-
#else
|
4776
|
-
if (PyCFunction_Check(func))
|
4777
|
-
#endif
|
4778
|
-
{
|
4779
|
-
if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
|
4780
|
-
return __Pyx_PyObject_CallMethO(func, NULL);
|
4781
|
-
}
|
4782
|
-
}
|
5415
|
+
if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
|
5416
|
+
return __Pyx_PyObject_CallMethO(func, NULL);
|
4783
5417
|
}
|
4784
5418
|
else if (nargs == 1 && kwargs == NULL) {
|
4785
|
-
if (
|
4786
|
-
|
4787
|
-
if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
|
4788
|
-
return __Pyx_PyObject_CallMethO(func, args[0]);
|
4789
|
-
}
|
4790
|
-
}
|
5419
|
+
if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
|
5420
|
+
return __Pyx_PyObject_CallMethO(func, args[0]);
|
4791
5421
|
}
|
4792
5422
|
#endif
|
4793
5423
|
#if PY_VERSION_HEX < 0x030800B1
|
@@ -4811,25 +5441,31 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj
|
|
4811
5441
|
}
|
4812
5442
|
#endif
|
4813
5443
|
#endif
|
4814
|
-
|
4815
|
-
|
4816
|
-
|
4817
|
-
|
4818
|
-
|
4819
|
-
|
4820
|
-
|
4821
|
-
|
4822
|
-
|
4823
|
-
|
4824
|
-
|
4825
|
-
|
4826
|
-
|
5444
|
+
if (kwargs == NULL) {
|
5445
|
+
#if CYTHON_VECTORCALL
|
5446
|
+
#if PY_VERSION_HEX < 0x03090000
|
5447
|
+
vectorcallfunc f = _PyVectorcall_Function(func);
|
5448
|
+
#else
|
5449
|
+
vectorcallfunc f = PyVectorcall_Function(func);
|
5450
|
+
#endif
|
5451
|
+
if (f) {
|
5452
|
+
return f(func, args, (size_t)nargs, NULL);
|
5453
|
+
}
|
5454
|
+
#elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL
|
5455
|
+
if (__Pyx_CyFunction_CheckExact(func)) {
|
5456
|
+
__pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func);
|
5457
|
+
if (f) return f(func, args, (size_t)nargs, NULL);
|
5458
|
+
}
|
5459
|
+
#endif
|
4827
5460
|
}
|
4828
|
-
#endif
|
4829
5461
|
if (nargs == 0) {
|
4830
5462
|
return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs);
|
4831
5463
|
}
|
5464
|
+
#if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API
|
5465
|
+
return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs);
|
5466
|
+
#else
|
4832
5467
|
return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs);
|
5468
|
+
#endif
|
4833
5469
|
}
|
4834
5470
|
|
4835
5471
|
/* PyObjectCallOneArg */
|
@@ -5022,7 +5658,7 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
|
|
5022
5658
|
{
|
5023
5659
|
#if PY_MAJOR_VERSION >= 3
|
5024
5660
|
if (level == -1) {
|
5025
|
-
if (
|
5661
|
+
if (strchr(__Pyx_MODULE_NAME, '.') != NULL) {
|
5026
5662
|
module = PyImport_ImportModuleLevelObject(
|
5027
5663
|
name, __pyx_d, empty_dict, from_list, 1);
|
5028
5664
|
if (unlikely(!module)) {
|
@@ -5175,10 +5811,7 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject
|
|
5175
5811
|
|
5176
5812
|
/* FetchSharedCythonModule */
|
5177
5813
|
static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
|
5178
|
-
|
5179
|
-
if (unlikely(!abi_module)) return NULL;
|
5180
|
-
Py_INCREF(abi_module);
|
5181
|
-
return abi_module;
|
5814
|
+
return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME);
|
5182
5815
|
}
|
5183
5816
|
|
5184
5817
|
/* FetchCommonType */
|
@@ -5339,6 +5972,20 @@ static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, _
|
|
5339
5972
|
#endif
|
5340
5973
|
|
5341
5974
|
/* CythonFunctionShared */
|
5975
|
+
#if CYTHON_COMPILING_IN_LIMITED_API
|
5976
|
+
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) {
|
5977
|
+
if (__Pyx_CyFunction_Check(func)) {
|
5978
|
+
return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc;
|
5979
|
+
} else if (PyCFunction_Check(func)) {
|
5980
|
+
return PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
|
5981
|
+
}
|
5982
|
+
return 0;
|
5983
|
+
}
|
5984
|
+
#else
|
5985
|
+
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) {
|
5986
|
+
return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
|
5987
|
+
}
|
5988
|
+
#endif
|
5342
5989
|
static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) {
|
5343
5990
|
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
|
5344
5991
|
__Pyx_Py_XDECREF_SET(
|
@@ -6148,7 +6795,7 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func,
|
|
6148
6795
|
default:
|
6149
6796
|
return NULL;
|
6150
6797
|
}
|
6151
|
-
return ((
|
6798
|
+
return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames);
|
6152
6799
|
}
|
6153
6800
|
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
|
6154
6801
|
{
|
@@ -6513,8 +7160,8 @@ static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject
|
|
6513
7160
|
Py_DECREF(replace);
|
6514
7161
|
return result;
|
6515
7162
|
}
|
6516
|
-
#if __PYX_LIMITED_VERSION_HEX < 0x030780000
|
6517
7163
|
PyErr_Clear();
|
7164
|
+
#if __PYX_LIMITED_VERSION_HEX < 0x030780000
|
6518
7165
|
{
|
6519
7166
|
PyObject *compiled = NULL, *result = NULL;
|
6520
7167
|
if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL;
|
@@ -6534,6 +7181,8 @@ static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject
|
|
6534
7181
|
if (result) Py_INCREF(result);
|
6535
7182
|
return result;
|
6536
7183
|
}
|
7184
|
+
#else
|
7185
|
+
return NULL;
|
6537
7186
|
#endif
|
6538
7187
|
}
|
6539
7188
|
static void __Pyx_AddTraceback(const char *funcname, int c_line,
|
@@ -6631,7 +7280,7 @@ static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
|
|
6631
7280
|
#else
|
6632
7281
|
py_code = PyCode_NewEmpty(filename, funcname, py_line);
|
6633
7282
|
#endif
|
6634
|
-
Py_XDECREF(py_funcname);
|
7283
|
+
Py_XDECREF(py_funcname);
|
6635
7284
|
return py_code;
|
6636
7285
|
bad:
|
6637
7286
|
Py_XDECREF(py_funcname);
|
@@ -6690,7 +7339,7 @@ __Pyx_PyType_GetName(PyTypeObject* tp)
|
|
6690
7339
|
if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) {
|
6691
7340
|
PyErr_Clear();
|
6692
7341
|
Py_XDECREF(name);
|
6693
|
-
name = __Pyx_NewRef(
|
7342
|
+
name = __Pyx_NewRef(__pyx_n_s__11);
|
6694
7343
|
}
|
6695
7344
|
return name;
|
6696
7345
|
}
|
@@ -6729,13 +7378,13 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
|
|
6729
7378
|
{
|
6730
7379
|
int one = 1; int little = (int)*(unsigned char *)&one;
|
6731
7380
|
unsigned char *bytes = (unsigned char *)&value;
|
6732
|
-
#if !CYTHON_COMPILING_IN_LIMITED_API
|
7381
|
+
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
|
6733
7382
|
return _PyLong_FromByteArray(bytes, sizeof(long),
|
6734
7383
|
little, !is_unsigned);
|
6735
7384
|
#else
|
6736
7385
|
PyObject *from_bytes, *result = NULL;
|
6737
7386
|
PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
|
6738
|
-
from_bytes = PyObject_GetAttrString((PyObject*)&
|
7387
|
+
from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
|
6739
7388
|
if (!from_bytes) return NULL;
|
6740
7389
|
py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long));
|
6741
7390
|
if (!py_bytes) goto limited_bad;
|
@@ -6743,16 +7392,18 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
|
|
6743
7392
|
if (!order_str) goto limited_bad;
|
6744
7393
|
arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
|
6745
7394
|
if (!arg_tuple) goto limited_bad;
|
6746
|
-
|
6747
|
-
|
6748
|
-
|
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
|
+
}
|
6749
7400
|
result = PyObject_Call(from_bytes, arg_tuple, kwds);
|
6750
7401
|
limited_bad:
|
6751
|
-
Py_XDECREF(from_bytes);
|
6752
|
-
Py_XDECREF(py_bytes);
|
6753
|
-
Py_XDECREF(order_str);
|
6754
|
-
Py_XDECREF(arg_tuple);
|
6755
7402
|
Py_XDECREF(kwds);
|
7403
|
+
Py_XDECREF(arg_tuple);
|
7404
|
+
Py_XDECREF(order_str);
|
7405
|
+
Py_XDECREF(py_bytes);
|
7406
|
+
Py_XDECREF(from_bytes);
|
6756
7407
|
return result;
|
6757
7408
|
#endif
|
6758
7409
|
}
|
@@ -6950,7 +7601,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
|
|
6950
7601
|
#endif
|
6951
7602
|
if (likely(v)) {
|
6952
7603
|
int ret = -1;
|
6953
|
-
#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)
|
6954
7605
|
int one = 1; int is_little = (int)*(unsigned char *)&one;
|
6955
7606
|
unsigned char *bytes = (unsigned char *)&val;
|
6956
7607
|
ret = _PyLong_AsByteArray((PyLongObject *)v,
|
@@ -7223,7 +7874,7 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
|
|
7223
7874
|
#endif
|
7224
7875
|
if (likely(v)) {
|
7225
7876
|
int ret = -1;
|
7226
|
-
#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)
|
7227
7878
|
int one = 1; int is_little = (int)*(unsigned char *)&one;
|
7228
7879
|
unsigned char *bytes = (unsigned char *)&val;
|
7229
7880
|
ret = _PyLong_AsByteArray((PyLongObject *)v,
|
@@ -7443,41 +8094,50 @@ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObj
|
|
7443
8094
|
#endif
|
7444
8095
|
|
7445
8096
|
/* CheckBinaryVersion */
|
7446
|
-
static
|
7447
|
-
|
7448
|
-
|
7449
|
-
|
7450
|
-
|
7451
|
-
|
7452
|
-
|
7453
|
-
|
7454
|
-
|
7455
|
-
|
8097
|
+
static unsigned long __Pyx_get_runtime_version(void) {
|
8098
|
+
#if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4
|
8099
|
+
return Py_Version & ~0xFFUL;
|
8100
|
+
#else
|
8101
|
+
const char* rt_version = Py_GetVersion();
|
8102
|
+
unsigned long version = 0;
|
8103
|
+
unsigned long factor = 0x01000000UL;
|
8104
|
+
unsigned int digit = 0;
|
8105
|
+
int i = 0;
|
8106
|
+
while (factor) {
|
8107
|
+
while ('0' <= rt_version[i] && rt_version[i] <= '9') {
|
8108
|
+
digit = digit * 10 + (unsigned int) (rt_version[i] - '0');
|
8109
|
+
++i;
|
7456
8110
|
}
|
7457
|
-
|
7458
|
-
|
8111
|
+
version += factor * digit;
|
8112
|
+
if (rt_version[i] != '.')
|
7459
8113
|
break;
|
7460
|
-
|
8114
|
+
digit = 0;
|
8115
|
+
factor >>= 8;
|
8116
|
+
++i;
|
7461
8117
|
}
|
7462
|
-
|
7463
|
-
|
8118
|
+
return version;
|
8119
|
+
#endif
|
8120
|
+
}
|
8121
|
+
static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) {
|
8122
|
+
const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
|
8123
|
+
if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
|
8124
|
+
return 0;
|
8125
|
+
if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
|
8126
|
+
return 1;
|
8127
|
+
{
|
7464
8128
|
char message[200];
|
7465
|
-
for (i=0; i<4; ++i) {
|
7466
|
-
if (rt_from_call[i] == '.') {
|
7467
|
-
if (found_dot) break;
|
7468
|
-
found_dot = 1;
|
7469
|
-
} else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') {
|
7470
|
-
break;
|
7471
|
-
}
|
7472
|
-
rtversion[i] = rt_from_call[i];
|
7473
|
-
}
|
7474
8129
|
PyOS_snprintf(message, sizeof(message),
|
7475
|
-
"compile time version %
|
7476
|
-
"
|
7477
|
-
|
8130
|
+
"compile time Python version %d.%d "
|
8131
|
+
"of module '%.100s' "
|
8132
|
+
"%s "
|
8133
|
+
"runtime version %d.%d",
|
8134
|
+
(int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF),
|
8135
|
+
__Pyx_MODULE_NAME,
|
8136
|
+
(allow_newer) ? "was newer than" : "does not match",
|
8137
|
+
(int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF)
|
8138
|
+
);
|
7478
8139
|
return PyErr_WarnEx(NULL, message, 1);
|
7479
8140
|
}
|
7480
|
-
return 0;
|
7481
8141
|
}
|
7482
8142
|
|
7483
8143
|
/* InitStrings */
|
@@ -7523,8 +8183,24 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
|
|
7523
8183
|
return 0;
|
7524
8184
|
}
|
7525
8185
|
|
8186
|
+
#include <string.h>
|
8187
|
+
static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) {
|
8188
|
+
size_t len = strlen(s);
|
8189
|
+
if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) {
|
8190
|
+
PyErr_SetString(PyExc_OverflowError, "byte string is too long");
|
8191
|
+
return -1;
|
8192
|
+
}
|
8193
|
+
return (Py_ssize_t) len;
|
8194
|
+
}
|
7526
8195
|
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
|
7527
|
-
|
8196
|
+
Py_ssize_t len = __Pyx_ssize_strlen(c_str);
|
8197
|
+
if (unlikely(len < 0)) return NULL;
|
8198
|
+
return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
|
8199
|
+
}
|
8200
|
+
static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) {
|
8201
|
+
Py_ssize_t len = __Pyx_ssize_strlen(c_str);
|
8202
|
+
if (unlikely(len < 0)) return NULL;
|
8203
|
+
return PyByteArray_FromStringAndSize(c_str, len);
|
7528
8204
|
}
|
7529
8205
|
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
|
7530
8206
|
Py_ssize_t ignore;
|