Skip to content

Commit 07da1db

Browse files
committed
refactor: move the _PyDictViewObject shim to the pyshim.hh header file
1 parent db5ba71 commit 07da1db

File tree

8 files changed

+17
-38
lines changed

8 files changed

+17
-38
lines changed

include/JSObjectItemsProxy.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include <jsapi.h>
1515

1616
#include <Python.h>
17-
#include "include/dictviewShim.hh"
17+
#include "include/pyshim.hh"
1818

1919

2020
/**

include/JSObjectKeysProxy.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include <jsapi.h>
1515

1616
#include <Python.h>
17-
#include "include/dictviewShim.hh"
17+
#include "include/pyshim.hh"
1818

1919

2020
/**

include/JSObjectValuesProxy.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include <jsapi.h>
1515

1616
#include <Python.h>
17-
#include "include/dictviewShim.hh"
17+
#include "include/pyshim.hh"
1818

1919

2020
/**

include/dictviewShim.hh

Lines changed: 0 additions & 28 deletions
This file was deleted.

include/pyshim.hh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,15 @@
2525
#define Py_IsFinalizing _Py_IsFinalizing
2626
#endif
2727

28+
/**
29+
* @brief `_PyDictViewObject` type definition moved from Python's public API
30+
* to the **internal** header file `internal/pycore_dict.h` in Python 3.13.
31+
*
32+
* @see https://github.com/python/cpython/blob/v3.13.0rc1/Include/internal/pycore_dict.h#L64-L72
33+
*/
34+
typedef struct {
35+
PyObject_HEAD
36+
PyDictObject *dv_dict;
37+
} _PyDictViewObject;
38+
2839
#endif // #ifndef PythonMonkey_py_version_shim_

src/JSObjectKeysProxy.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@
2222
#include <jsfriendapi.h>
2323

2424
#include <Python.h>
25-
#include "include/dictviewShim.hh"
26-
27-
25+
#include "include/pyshim.hh"
2826

2927
void JSObjectKeysProxyMethodDefinitions::JSObjectKeysProxy_dealloc(JSObjectKeysProxy *self)
3028
{

src/JSObjectProxy.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include <jsfriendapi.h>
2828

2929
#include <Python.h>
30-
#include "include/dictviewShim.hh"
30+
#include "include/pyshim.hh"
3131

3232
#include <object.h>
3333

src/JSObjectValuesProxy.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@
2222
#include <jsfriendapi.h>
2323

2424
#include <Python.h>
25-
#include "include/dictviewShim.hh"
26-
27-
25+
#include "include/pyshim.hh"
2826

2927
void JSObjectValuesProxyMethodDefinitions::JSObjectValuesProxy_dealloc(JSObjectValuesProxy *self)
3028
{

0 commit comments

Comments
 (0)