| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
| |
extension modules and objects (#135614) (#136126)
gh-135607: remove null checking of weakref list in dealloc of extension modules and objects (#135614)
(cherry picked from commit b1056c2a446b43452e457d5fd5f1bde66afd3883)
Co-authored-by: Xuanteng Huang <44627253+xuantengh@users.noreply.github.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
|
| |
|
| |
Co-authored-by: i.khabibulin <i.khabibulin@ngrsoftlab.ru>
|
| |
|
|
| |
(GH-111221)
|
| |
|
|
| |
(GH-111210)
|
| |
|
|
|
|
|
|
|
|
| |
Move private functions to the internal C API (pycore_sysmodule.h):
* _PySys_GetAttr()
* _PySys_GetSizeOf()
No longer export most of these functions.
Fix also a typo in Include/cpython/optimizer.h: add a missing space.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Remove '#include "structmember.h"'.
* If needed, add <stddef.h> to get offsetof() function.
* Update Parser/asdl_c.py to regenerate Python/Python-ast.c.
* Replace:
* T_SHORT => Py_T_SHORT
* T_INT => Py_T_INT
* T_LONG => Py_T_LONG
* T_FLOAT => Py_T_FLOAT
* T_DOUBLE => Py_T_DOUBLE
* T_STRING => Py_T_STRING
* T_OBJECT => _Py_T_OBJECT
* T_CHAR => Py_T_CHAR
* T_BYTE => Py_T_BYTE
* T_UBYTE => Py_T_UBYTE
* T_USHORT => Py_T_USHORT
* T_UINT => Py_T_UINT
* T_ULONG => Py_T_ULONG
* T_STRING_INPLACE => Py_T_STRING_INPLACE
* T_BOOL => Py_T_BOOL
* T_OBJECT_EX => Py_T_OBJECT_EX
* T_LONGLONG => Py_T_LONGLONG
* T_ULONGLONG => Py_T_ULONGLONG
* T_PYSSIZET => Py_T_PYSSIZET
* T_NONE => _Py_T_NONE
* READONLY => Py_READONLY
* PY_AUDIT_READ => Py_AUDIT_READ
* READ_RESTRICTED => Py_AUDIT_READ
* PY_WRITE_RESTRICTED => _Py_WRITE_RESTRICTED
* RESTRICTED => (READ_RESTRICTED | _Py_WRITE_RESTRICTED)
|
| |
|
|
| |
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add references to static types to _PyIO_State:
* PyBufferedIOBase_Type
* PyBytesIOBuffer_Type
* PyIncrementalNewlineDecoder_Type
* PyRawIOBase_Type
* PyTextIOBase_Type
* Add the defining class to methods:
* _io.BytesIO.getbuffer()
* _io.FileIO.close()
* Add get_io_state_by_cls() function.
* Add state parameter to _textiowrapper_decode()
* _io_TextIOWrapper___init__() now sets self->state before calling
_textiowrapper_set_decoder().
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
|
| |
|
|
|
| |
Adapt StringIO, TextIOWrapper, FileIO, Buffered*, and BytesIO types.
Automerge-Triggered-By: GH:erlend-aasland
|
| |
|
|
|
|
|
|
| |
The implementation of __sizeof__() methods using _PyObject_SIZE() now
use an unsigned type (size_t) to compute the size, rather than a signed
type (Py_ssize_t).
Cast explicitly signed (Py_ssize_t) values to unsigned type
(Py_ssize_t).
|
| |
|
|
| |
Replace Py_INCREF() and Py_XINCREF() with Py_NewRef() and
Py_XNewRef() in test C files of the Modules/ directory.
|
| |
|
|
|
| |
* Rename _Py_NO_INLINE macro to Py_NO_INLINE: make it public and
document it.
* Sort macros in the C API documentation.
|
| |
|
|
|
|
| |
If only offsetof() is needed: include stddef.h instead.
When structmember.h is used, add a comment explaining that
PyMemberDef is used.
|
| |
|
|
| |
(GH-19472)
|
| |
|
|
| |
Windows. (GH-16347)
|
| | |
|
| |
|
| |
Avoid the creation of unused int object for each line.
|
| |
|
| |
bytesio_sizeof() must check if an error has occurred in _PySys_GetSizeOf().
|
| |
|
|
|
|
|
|
|
| |
(GH-13464)
Automatically replace
tp_print -> tp_vectorcall_offset
tp_compare -> tp_as_async
tp_reserved -> tp_as_async
|
| |
|
| |
Fix also return type for few other functions (clear, releasebuffer).
|
| |
|
|
| |
Move _PyObject_GC_TRACK() and _PyObject_GC_UNTRACK() from
Include/objimpl.h to Include/internal/pycore_object.h.
|
| |
|
|
|
|
|
|
|
| |
(GH-6030)
METH_NOARGS functions need only a single argument but they are cast
into a PyCFunction, which takes two arguments. This triggers an
invalid function cast warning in gcc8 due to the argument mismatch.
Fix this by adding a dummy unused argument.
|
| | |
|
| |
|
| |
if pass `accept={int, NoneType}`.
|
| |
|
|
| |
(#748)
|
| |
|
|
| |
messages (#650)
|
| |
|
| |
Some BytesIO methods now accept not just int subclasses but other int-like types.
|
| | |
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| | |
This matches the usage of ZipFile and BufferedWriter. This still requires
return values to be bytes() objects.
Also document and test that the write() methods should only access their
argument before they return.
|
| |\ \
| |/ |
|
| | | |
|
| |\ \
| |/
| |
| | |
in places where Py_DECREF was used.
|
| |\ \
| |/ |
|
| | | |
|
| |/
|
|
|
| |
Old code is correct, but with Py_SETREF and Py_CLEAR it can be cleaner.
This patch doesn't fix bugs and hence there is no need to backport it.
|
| |
|
|
| |
macro Py_SETREF.
|
| |
|
|
|
| |
This allows sys.getsize() to work correctly with their subclasses with
__slots__ defined.
|
| |
|
|
| |
set beyond size. Based on patch by John Leitch.
|
| |
|
|
| |
instead of types={'type'} to specify the types the converter accepts.
|
| | |
|
| |\ |
|
| | | |
|
| | |
| |
| |
| | |
and array_buffer_getbuf().
|
| | |
| |
| |
| |
| |
| | |
It was expected that string_size == PyBytes_GET_SIZE(buf) if the buffer is
shared, but truncate() and __setstate__() can set string_size without
unsharing the buffer.
|
| | |
| |
| |
| | |
shared.
|
| | | |
|
| |\ \
| |/
| |
| | |
prevent corrupting exported buffer.
|
| | |
| |
| |
| | |
prevent corrupting exported buffer.
|