Skip to content

Commit 73c8f64

Browse files
committed
remove reconstruct dtype functions made unnecessary by upstream fixes
1 parent 457fc76 commit 73c8f64

File tree

4 files changed

+8
-14
lines changed

4 files changed

+8
-14
lines changed

asciidtype/asciidtype/__init__.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,7 @@
77
from .scalar import ASCIIScalar # isort: skip
88
from ._asciidtype_main import ASCIIDType
99

10-
11-
def _reconstruct_ASCIIDType(*args):
12-
# this is needed for pickling instances because numpy overrides the pickling
13-
# behavior of the DTypeMeta class using copyreg. By pickling a wrapper
14-
# around the ASCIIDType initializer, we avoid triggering the code in numpy
15-
# that tries to handle pickling DTypeMeta instances. See
16-
# https://github.com/numpy/numpy/issues/23135#issuecomment-1410967842
17-
return ASCIIDType(*args)
18-
19-
20-
__all__ = ["ASCIIDType", "ASCIIScalar", "_reconstruct_ASCIIDType"]
10+
__all__ = [
11+
"ASCIIDType",
12+
"ASCIIScalar",
13+
]

asciidtype/asciidtype/src/dtype.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ asciidtype__reduce__(ASCIIDTypeObject *self)
244244
return NULL;
245245
}
246246

247-
obj = PyObject_GetAttrString(mod, "_reconstruct_ASCIIDType");
247+
obj = PyObject_GetAttrString(mod, "ASCIIDType");
248248
Py_DECREF(mod);
249249
if (obj == NULL) {
250250
Py_DECREF(ret);

stringdtype/stringdtype/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from .scalar import StringScalar # isort: skip
66
from ._main import StringDType, _memory_usage
77

8+
89
__all__ = [
910
"StringDType",
1011
"StringScalar",

stringdtype/stringdtype/src/dtype.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ stringdtype_repr(StringDTypeObject *NPY_UNUSED(self))
204204
static int PICKLE_VERSION = 1;
205205

206206
static PyObject *
207-
stringdtype__reduce__(StringDTypeObject *self)
207+
stringdtype__reduce__(StringDTypeObject *NPY_UNUSED(self))
208208
{
209209
PyObject *ret, *mod, *obj, *state;
210210

@@ -219,7 +219,7 @@ stringdtype__reduce__(StringDTypeObject *self)
219219
return NULL;
220220
}
221221

222-
obj = PyObject_GetAttrString(mod, "_reconstruct_StringDType");
222+
obj = PyObject_GetAttrString(mod, "StringDType");
223223
Py_DECREF(mod);
224224
if (obj == NULL) {
225225
Py_DECREF(ret);

0 commit comments

Comments
 (0)