summaryrefslogtreecommitdiffstats
path: root/Include/structseq.h
Commit message (Collapse)AuthorAgeFilesLines
* gh-106168: PyTuple_SET_ITEM() now checks the index (#106164)Victor Stinner2023-06-281-8/+5
| | | | | | | | | | | | | PyTuple_SET_ITEM() and PyList_SET_ITEM() now check the index argument with an assertion if Python is built in debug mode or is built with assertions. * list_extend() and _PyList_AppendTakeRef() now set the list size before calling PyList_SET_ITEM(). * PyStructSequence_GetItem() and PyStructSequence_SetItem() now check the index argument: must be lesser than REAL_SIZE(op). * PyStructSequence_GET_ITEM() and PyStructSequence_SET_ITEM() are now aliases to PyStructSequence_GetItem() and PyStructSequence_SetItem().
* gh-87347: Add parenthesis around macro arguments (#93915)Victor Stinner2022-06-201-2/+2
| | | Add unit test on Py_MEMBER_SIZE() and some other macros.
* bpo-45459: C API uses type names rather than structure names (GH-31528)Victor Stinner2022-02-241-1/+1
| | | | Thanks to the new pytypedefs.h, it becomes to use type names like PyObject rather like structure names like "struct _object".
* bpo-46417: _curses uses PyStructSequence_NewType() (GH-30736)Victor Stinner2022-01-211-3/+0
| | | | | | | | The _curses module now creates its ncurses_version type as a heap type using PyStructSequence_NewType(), rather than using a static type. * Move _PyStructSequence_FiniType() definition to pycore_structseq.h. * test.pythoninfo: log curses.ncurses_version.
* bpo-46417: Finalize structseq types at exit (GH-30645)Victor Stinner2022-01-211-0/+3
| | | | | | | | | | | | | | | | | | Add _PyStructSequence_FiniType() and _PyStaticType_Dealloc() functions to finalize a structseq static type in Py_Finalize(). Currrently, these functions do nothing if Python is built in release mode. Clear static types: * AsyncGenHooksType: sys.set_asyncgen_hooks() * FlagsType: sys.flags * FloatInfoType: sys.float_info * Hash_InfoType: sys.hash_info * Int_InfoType: sys.int_info * ThreadInfoType: sys.thread_info * UnraisableHookArgsType: sys.unraisablehook * VersionInfoType: sys.version * WindowsVersionType: sys.getwindowsversion()
* bpo-44220: Export PyStructSequence_UnnamedField in the limited API (GH-26331)Ken Jin2021-10-211-1/+1
|
* bpo-43916: Move the _PyStructSequence_InitType function to the internal API ↵Pablo Galindo2021-05-031-4/+0
| | | | (GH-25854)
* bpo-43916: Export the _PyStructSequence_InitType to fix build errors in the ↵Pablo Galindo2021-05-011-3/+1
| | | | curses module (GH-25768)
* bpo-43916: Add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag (GH-25721)Victor Stinner2021-04-301-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new Py_TPFLAGS_DISALLOW_INSTANTIATION type flag to disallow creating type instances: set tp_new to NULL and don't create the "__new__" key in the type dictionary. The flag is set automatically on static types if tp_base is NULL or &PyBaseObject_Type and tp_new is NULL. Use the flag on the following types: * _curses.ncurses_version type * _curses_panel.panel * _tkinter.Tcl_Obj * _tkinter.tkapp * _tkinter.tktimertoken * _xxsubinterpretersmodule.ChannelID * sys.flags type * sys.getwindowsversion() type * sys.version_info type Update MyStr example in the C API documentation to use Py_TPFLAGS_DISALLOW_INSTANTIATION. Add _PyStructSequence_InitType() function to create a structseq type with the Py_TPFLAGS_DISALLOW_INSTANTIATION flag set. type_new() calls _PyType_CheckConsistency() at exit.
* bpo-38650: Constify PyStructSequence_UnnamedField. (GH-17005)Serhiy Storchaka2019-11-161-1/+1
| | | | Make it a constant and referring to a constant string.
* Issue #28761: The fields name and doc of structures PyMemberDef, PyGetSetDef,Serhiy Storchaka2016-11-221-4/+4
| | | | | PyStructSequence_Field, PyStructSequence_Desc, and wrapperbase are now of type "const char *" rather of "char *".
* Issue #18520: Add a new PyStructSequence_InitType2() function, same thanVictor Stinner2013-07-221-0/+2
| | | | | | | | PyStructSequence_InitType() except that it has a return value (0 on success, -1 on error). * PyStructSequence_InitType2() now raises MemoryError on memory allocation failure * Fix also some calls to PyDict_SetItemString(): handle error
* Merge branches/pep-0384.Martin v. Löwis2010-12-031-0/+7
|
* correct commentBenjamin Peterson2010-08-091-1/+1
|
* make struct sequences subclass tuple; kill lots of codeBenjamin Peterson2010-07-071-8/+3
| | | | This fixes #8413.
* Recorded merge of revisions 81029 via svnmerge fromAntoine Pitrou2010-05-091-11/+11
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines Untabify C files. Will watch buildbots. ........
* Remove PyArg_Parse usage from time module. (An extra set of eyeballs onSkip Montanaro2007-08-241-0/+4
| | | | this would be nice. I'm a little rusty.)
* Clean up some whitespace to be consistent with Python's C style.Fred Drake2002-10-171-4/+4
|
* Add PyStructSequence_UnnamedField. Add stat_float_times.Martin v. Löwis2002-10-161-0/+2
| | | | Use integers in stat tuple, optionally floats in named fields.
* Excise DL_EXPORT from Include.Mark Hammond2002-08-121-2/+2
| | | | Thanks to Skip Montanaro and Kalle Svensson for the patches.
* SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.Guido van Rossum2001-10-181-0/+39
This is a big one, touching lots of files. Some of the platforms aren't tested yet. Briefly, this changes the return value of the os/posix functions stat(), fstat(), statvfs(), fstatvfs(), and the time functions localtime(), gmtime(), and strptime() from tuples into pseudo-sequences. When accessed as a sequence, they behave exactly as before. But they also have attributes like st_mtime or tm_year. The stat return value, moreover, has a few platform-specific attributes that are not available through the sequence interface (because everybody expects the sequence to have a fixed length, these couldn't be added there). If your platform's struct stat doesn't define st_blksize, st_blocks or st_rdev, they won't be accessible from Python either. (Still missing is a documentation update.)