| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent bc5356b commit e4ede8e
9 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -763,6 +763,11 @@ Connection objects | |||
| 763 | 763 | ... print(row) | |
| 764 | 764 | ('acbd18db4cc2f85cedef654fccc4a4d8',) | |
| 765 | 765 | ||
| 766 | + .. versionchanged:: 3.13 | ||
| 767 | + | ||
| 768 | + Passing *name*, *narg*, and *func* as keyword arguments is deprecated. | ||
| 769 | + These parameters will become positional-only in Python 3.15. | ||
| 770 | + | ||
| 766 | 771 | ||
| 767 | 772 | .. method:: create_aggregate(name, n_arg, aggregate_class) | |
| 768 | 773 | ||
@@ -817,6 +822,11 @@ Connection objects | |||
| 817 | 822 | ||
| 818 | 823 | 3 | |
| 819 | 824 | ||
| 825 | + .. versionchanged:: 3.13 | ||
| 826 | + | ||
| 827 | + Passing *name*, *n_arg*, and *aggregate_class* as keyword arguments is deprecated. | ||
| 828 | + These parameters will become positional-only in Python 3.15. | ||
| 829 | + | ||
| 820 | 830 | ||
| 821 | 831 | .. method:: create_window_function(name, num_params, aggregate_class, /) | |
| 822 | 832 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -252,7 +252,16 @@ Deprecated | |||
| 252 | 252 | * Passing more than one positional argument to :func:`sqlite3.connect` and the | |
| 253 | 253 | :class:`sqlite3.Connection` constructor is deprecated. The remaining | |
| 254 | 254 | parameters will become keyword-only in Python 3.15. | |
| 255 | - (Contributed by Erlend E. Aasland in :gh:`107948`.) | ||
| 255 | + | ||
| 256 | + Deprecate passing name, number of arguments, and the callable as keyword | ||
| 257 | + arguments, for the following :class:`sqlite3.Connection` APIs: | ||
| 258 | + | ||
| 259 | + * :meth:`~sqlite3.Connection.create_function` | ||
| 260 | + * :meth:`~sqlite3.Connection.create_aggregate` | ||
| 261 | + | ||
| 262 | + The affected parameters will become positional-only in Python 3.15. | ||
| 263 | + | ||
| 264 | + (Contributed by Erlend E. Aasland in :gh:`107948` and :gh:`108278`.) | ||
| 256 | 265 | ||
| 257 | 266 | Pending Removal in Python 3.14 | |
| 258 | 267 | ------------------------------ | |
@@ -877,6 +886,10 @@ New Features | |||
| 877 | 886 | (with an underscore prefix). | |
| 878 | 887 | (Contributed by Victor Stinner in :gh:`108014`.) | |
| 879 | 888 | ||
| 889 | + * Add :c:func:`PyMem_RawMalloc`, :c:func:`PyMem_RawCalloc`, | ||
| 890 | + :c:func:`PyMem_RawRealloc` and :c:func:`PyMem_RawFree` to the limited C API. | ||
| 891 | + (Contributed by Victor Stinner in :gh:`85283`.) | ||
| 892 | + | ||
| 880 | 893 | Porting to Python 3.13 | |
| 881 | 894 | ---------------------- | |
| 882 | 895 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,12 +2,6 @@ | |||
| 2 | 2 | # error "this header file must not be included directly" | |
| 3 | 3 | #endif | |
| 4 | 4 | ||
| 5 | - PyAPI_FUNC(void *) PyMem_RawMalloc(size_t size); | ||
| 6 | - PyAPI_FUNC(void *) PyMem_RawCalloc(size_t nelem, size_t elsize); | ||
| 7 | - PyAPI_FUNC(void *) PyMem_RawRealloc(void *ptr, size_t new_size); | ||
| 8 | - PyAPI_FUNC(void) PyMem_RawFree(void *ptr); | ||
| 9 | - | ||
| 10 | - | ||
| 11 | 5 | typedef enum { | |
| 12 | 6 | /* PyMem_RawMalloc(), PyMem_RawRealloc() and PyMem_RawFree() */ | |
| 13 | 7 | PYMEM_DOMAIN_RAW, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -91,6 +91,12 @@ PyAPI_FUNC(void) PyMem_Free(void *ptr); | |||
| 91 | 91 | #define PyMem_DEL(p) PyMem_Free((p)) | |
| 92 | 92 | ||
| 93 | 93 | ||
| 94 | + // Allocator which doesn't require the GIL to be held | ||
| 95 | + PyAPI_FUNC(void *) PyMem_RawMalloc(size_t size); | ||
| 96 | + PyAPI_FUNC(void *) PyMem_RawCalloc(size_t nelem, size_t elsize); | ||
| 97 | + PyAPI_FUNC(void *) PyMem_RawRealloc(void *ptr, size_t new_size); | ||
| 98 | + PyAPI_FUNC(void) PyMem_RawFree(void *ptr); | ||
| 99 | + | ||
| 94 | 100 | #ifndef Py_LIMITED_API | |
| 95 | 101 | # define Py_CPYTHON_PYMEM_H | |
| 96 | 102 | # include "cpython/pymem.h" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -421,6 +421,29 @@ def test_func_return_illegal_value(self): | |||
| 421 | 421 | self.assertRaisesRegex(sqlite.OperationalError, msg, | |
| 422 | 422 | self.con.execute, "select badreturn()") | |
| 423 | 423 | ||
| 424 | + def test_func_keyword_args(self): | ||
| 425 | + regex = ( | ||
| 426 | + r"Passing keyword arguments 'name', 'narg' and 'func' to " | ||
| 427 | + r"_sqlite3.Connection.create_function\(\) is deprecated. " | ||
| 428 | + r"Parameters 'name', 'narg' and 'func' will become " | ||
| 429 | + r"positional-only in Python 3.15." | ||
| 430 | + ) | ||
| 431 | + | ||
| 432 | + def noop(): | ||
| 433 | + return None | ||
| 434 | + | ||
| 435 | + with self.assertWarnsRegex(DeprecationWarning, regex) as cm: | ||
| 436 | + self.con.create_function("noop", 0, func=noop) | ||
| 437 | + self.assertEqual(cm.filename, __file__) | ||
| 438 | + | ||
| 439 | + with self.assertWarnsRegex(DeprecationWarning, regex) as cm: | ||
| 440 | + self.con.create_function("noop", narg=0, func=noop) | ||
| 441 | + self.assertEqual(cm.filename, __file__) | ||
| 442 | + | ||
| 443 | + with self.assertWarnsRegex(DeprecationWarning, regex) as cm: | ||
| 444 | + self.con.create_function(name="noop", narg=0, func=noop) | ||
| 445 | + self.assertEqual(cm.filename, __file__) | ||
| 446 | + | ||
| 424 | 447 | ||
| 425 | 448 | class WindowSumInt: | |
| 426 | 449 | def __init__(self): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,3 @@ | |||
| 1 | + Add :c:func:`PyMem_RawMalloc`, :c:func:`PyMem_RawCalloc`, | ||
| 2 | + :c:func:`PyMem_RawRealloc` and :c:func:`PyMem_RawFree` to the limited C API. | ||
| 3 | + Patch by Victor Stinner. | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,9 @@ | |||
| 1 | + Deprecate passing name, number of arguments, and the callable as keyword | ||
| 2 | + arguments, for the following :class:`sqlite3.Connection` APIs: | ||
| 3 | + | ||
| 4 | + * :meth:`~sqlite3.Connection.create_function` | ||
| 5 | + * :meth:`~sqlite3.Connection.create_aggregate` | ||
| 6 | + | ||
| 7 | + The affected parameters will become positional-only in Python 3.15. | ||
| 8 | + | ||
| 9 | + Patch by Erlend E. Aasland. | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1139,6 +1139,7 @@ _sqlite3.Connection.create_function as pysqlite_connection_create_function | |||
| 1139 | 1139 | name: str | |
| 1140 | 1140 | narg: int | |
| 1141 | 1141 | func: object | |
| 1142 | + / [from 3.15] | ||
| 1142 | 1143 | * | |
| 1143 | 1144 | deterministic: bool = False | |
| 1144 | 1145 | ||
@@ -1150,7 +1151,7 @@ pysqlite_connection_create_function_impl(pysqlite_Connection *self, | |||
| 1150 | 1151 | PyTypeObject *cls, const char *name, | |
| 1151 | 1152 | int narg, PyObject *func, | |
| 1152 | 1153 | int deterministic) | |
| 1153 | - /*[clinic end generated code: output=8a811529287ad240 input=b3e8e1d8ddaffbef]*/ | ||
| 1154 | + /*[clinic end generated code: output=8a811529287ad240 input=c7c313b0ca8b519e]*/ | ||
| 1154 | 1155 | { | |
| 1155 | 1156 | int rc; | |
| 1156 | 1157 | int flags = SQLITE_UTF8; | |
@@ -1341,6 +1342,7 @@ _sqlite3.Connection.create_aggregate as pysqlite_connection_create_aggregate | |||
| 1341 | 1342 | name: str | |
| 1342 | 1343 | n_arg: int | |
| 1343 | 1344 | aggregate_class: object | |
| 1345 | + / [from 3.15] | ||
| 1344 | 1346 | ||
| 1345 | 1347 | Creates a new aggregate. | |
| 1346 | 1348 | [clinic start generated code]*/ | |
@@ -1350,7 +1352,7 @@ pysqlite_connection_create_aggregate_impl(pysqlite_Connection *self, | |||
| 1350 | 1352 | PyTypeObject *cls, | |
| 1351 | 1353 | const char *name, int n_arg, | |
| 1352 | 1354 | PyObject *aggregate_class) | |
| 1353 | - /*[clinic end generated code: output=1b02d0f0aec7ff96 input=68a2a26366d4c686]*/ | ||
| 1355 | + /*[clinic end generated code: output=1b02d0f0aec7ff96 input=8087056db6eae1cf]*/ | ||
| 1354 | 1356 | { | |
| 1355 | 1357 | int rc; | |
| 1356 | 1358 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments