omlish-cext 0.0.0.dev555__tar.gz → 0.0.0.dev556__tar.gz

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.
Files changed (22) hide show
  1. {omlish_cext-0.0.0.dev555/omlish_cext.egg-info → omlish_cext-0.0.0.dev556}/PKG-INFO +2 -2
  2. {omlish_cext-0.0.0.dev555 → omlish_cext-0.0.0.dev556}/omlish/lang/_comparison.cc +53 -0
  3. {omlish_cext-0.0.0.dev555 → omlish_cext-0.0.0.dev556/omlish_cext.egg-info}/PKG-INFO +2 -2
  4. omlish_cext-0.0.0.dev556/omlish_cext.egg-info/requires.txt +1 -0
  5. {omlish_cext-0.0.0.dev555 → omlish_cext-0.0.0.dev556}/pyproject.toml +2 -2
  6. omlish_cext-0.0.0.dev555/omlish_cext.egg-info/requires.txt +0 -1
  7. {omlish_cext-0.0.0.dev555 → omlish_cext-0.0.0.dev556}/LICENSE +0 -0
  8. {omlish_cext-0.0.0.dev555 → omlish_cext-0.0.0.dev556}/README.md +0 -0
  9. {omlish_cext-0.0.0.dev555 → omlish_cext-0.0.0.dev556}/omlish/_check.cc +0 -0
  10. {omlish_cext-0.0.0.dev555 → omlish_cext-0.0.0.dev556}/omlish/collections/fixed/_fixedmap.cc +0 -0
  11. {omlish_cext-0.0.0.dev555 → omlish_cext-0.0.0.dev556}/omlish/collections/hamt/_hamt.c +0 -0
  12. {omlish_cext-0.0.0.dev555 → omlish_cext-0.0.0.dev556}/omlish/collections/treap/_treap.cc +0 -0
  13. {omlish_cext-0.0.0.dev555 → omlish_cext-0.0.0.dev556}/omlish/dispatch/_dispatch.cc +0 -0
  14. {omlish_cext-0.0.0.dev555 → omlish_cext-0.0.0.dev556}/omlish/dispatch/_methods.cc +0 -0
  15. {omlish_cext-0.0.0.dev555 → omlish_cext-0.0.0.dev556}/omlish/lang/_asyncs.cc +0 -0
  16. {omlish_cext-0.0.0.dev555 → omlish_cext-0.0.0.dev556}/omlish/lang/imports/_capture.cc +0 -0
  17. {omlish_cext-0.0.0.dev555 → omlish_cext-0.0.0.dev556}/omlish/typedvalues/_collection.cc +0 -0
  18. {omlish_cext-0.0.0.dev555 → omlish_cext-0.0.0.dev556}/omlish_cext.egg-info/SOURCES.txt +0 -0
  19. {omlish_cext-0.0.0.dev555 → omlish_cext-0.0.0.dev556}/omlish_cext.egg-info/dependency_links.txt +0 -0
  20. {omlish_cext-0.0.0.dev555 → omlish_cext-0.0.0.dev556}/omlish_cext.egg-info/top_level.txt +0 -0
  21. {omlish_cext-0.0.0.dev555 → omlish_cext-0.0.0.dev556}/setup.cfg +0 -0
  22. {omlish_cext-0.0.0.dev555 → omlish_cext-0.0.0.dev556}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: omlish-cext
3
- Version: 0.0.0.dev555
3
+ Version: 0.0.0.dev556
4
4
  Summary: omlish
5
5
  Author: wrmsr
6
6
  License-Expression: BSD-3-Clause
@@ -14,7 +14,7 @@ Classifier: Programming Language :: Python :: 3.13
14
14
  Requires-Python: >=3.13
15
15
  Description-Content-Type: text/markdown
16
16
  License-File: LICENSE
17
- Requires-Dist: omlish==0.0.0.dev555
17
+ Requires-Dist: omlish==0.0.0.dev556
18
18
  Dynamic: license-file
19
19
 
20
20
  # Overview
@@ -58,6 +58,58 @@ static PyObject * comparison_cmp(PyObject *module, PyObject *const *args, Py_ssi
58
58
 
59
59
  //
60
60
 
61
+ PyDoc_STRVAR(comparison_hash_eq_id_cmp_doc, "hash_eq_id_cmp(l, r)");
62
+
63
+ static PyObject * comparison_hash_eq_id_cmp(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
64
+ {
65
+ if (nargs != 2) {
66
+ PyErr_Format(
67
+ PyExc_TypeError,
68
+ "hash_eq_id_cmp() takes exactly 2 positional arguments (%zd given)",
69
+ nargs
70
+ );
71
+ return nullptr;
72
+ }
73
+
74
+ PyObject *l = args[0];
75
+ PyObject *r = args[1];
76
+
77
+ if (l == r) {
78
+ return PyLong_FromLong(0);
79
+ }
80
+
81
+ int eq = PyObject_RichCompareBool(l, r, Py_EQ);
82
+ if (eq < 0) {
83
+ return nullptr;
84
+ }
85
+ if (eq) {
86
+ return PyLong_FromLong(0);
87
+ }
88
+
89
+ Py_hash_t hl = PyObject_Hash(l);
90
+ if (hl == -1 && PyErr_Occurred()) {
91
+ return nullptr;
92
+ }
93
+
94
+ Py_hash_t hr = PyObject_Hash(r);
95
+ if (hr == -1 && PyErr_Occurred()) {
96
+ return nullptr;
97
+ }
98
+
99
+ if (hl < hr) {
100
+ return PyLong_FromLong(-1);
101
+ } else if (hl > hr) {
102
+ return PyLong_FromLong(1);
103
+ }
104
+
105
+ uintptr_t il = reinterpret_cast<uintptr_t>(l);
106
+ uintptr_t ir = reinterpret_cast<uintptr_t>(r);
107
+
108
+ return PyLong_FromLong((il > ir) - (il < ir));
109
+ }
110
+
111
+ //
112
+
61
113
  typedef struct {
62
114
  PyObject_HEAD
63
115
  PyObject *fn;
@@ -315,6 +367,7 @@ static void comparison_free(void *module)
315
367
 
316
368
  static PyMethodDef comparison_methods[] = {
317
369
  {"cmp", (PyCFunction)comparison_cmp, METH_FASTCALL, comparison_cmp_doc},
370
+ {"hash_eq_id_cmp", (PyCFunction)comparison_hash_eq_id_cmp, METH_FASTCALL, comparison_hash_eq_id_cmp_doc},
318
371
  {"key_cmp", (PyCFunction)comparison_key_cmp, METH_FASTCALL, comparison_key_cmp_doc},
319
372
  {nullptr, nullptr, 0, nullptr}
320
373
  };
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: omlish-cext
3
- Version: 0.0.0.dev555
3
+ Version: 0.0.0.dev556
4
4
  Summary: omlish
5
5
  Author: wrmsr
6
6
  License-Expression: BSD-3-Clause
@@ -14,7 +14,7 @@ Classifier: Programming Language :: Python :: 3.13
14
14
  Requires-Python: >=3.13
15
15
  Description-Content-Type: text/markdown
16
16
  License-File: LICENSE
17
- Requires-Dist: omlish==0.0.0.dev555
17
+ Requires-Dist: omlish==0.0.0.dev556
18
18
  Dynamic: license-file
19
19
 
20
20
  # Overview
@@ -0,0 +1 @@
1
+ omlish==0.0.0.dev556
@@ -13,7 +13,7 @@ urls = {source = 'https://github.com/wrmsr/omlish'}
13
13
  license = 'BSD-3-Clause'
14
14
  readme = 'README.md'
15
15
  requires-python = '>=3.13'
16
- version = '0.0.0.dev555'
16
+ version = '0.0.0.dev556'
17
17
  classifiers = [
18
18
  'Development Status :: 2 - Pre-Alpha',
19
19
  'Intended Audience :: Developers',
@@ -24,7 +24,7 @@ classifiers = [
24
24
  ]
25
25
  description = 'omlish'
26
26
  dependencies = [
27
- 'omlish == 0.0.0.dev555',
27
+ 'omlish == 0.0.0.dev556',
28
28
  ]
29
29
 
30
30
  [tool.setuptools]
@@ -1 +0,0 @@
1
- omlish==0.0.0.dev555