summaryrefslogtreecommitdiffstats
path: root/Modules/clinic
Commit message (Collapse)AuthorAgeFilesLines
* Add missing 'is' to `cmath.log()` docstring (#102049)Owain Davies2023-02-191-2/+2
| | | Fix missing 'is' in cmath.log() docstring
* gh-101881: Support (non-)blocking read/write functions on Windows pipes ↵Rayyan Ansari2023-02-161-17/+1
| | | | | | | | | | | | (GH-101882) * fileutils: handle non-blocking pipe IO on Windows Handle erroring operations on non-blocking pipes by reading the _doserrno code. Limit writes on non-blocking pipes that are too large. * Support blocking functions on Windows Use the GetNamedPipeHandleState and SetNamedPipeHandleState Win32 API functions to add support for os.get_blocking and os.set_blocking.
* gh-99108: Refactor _sha256 & _sha512 into _sha2. (#101924)Gregory P. Smith2023-02-163-450/+440
| | | | | | | | | This merges their code. They're backed by the same single HACL* static library, having them be a single module simplifies maintenance. This should unbreak the wasm enscripten builds that currently fail due to linking in --whole-archive mode and the HACL* library appearing twice. Long unnoticed error fixed: _sha512.SHA384Type was doubly assigned and was actually SHA512Type. Nobody depends on those internal names. Also rename LIBHACL_ make vars to LIBHACL_SHA2_ in preperation for other future HACL things.
* gh-99138: Isolate _zoneinfo (#99218)Erlend E. Aasland2023-02-151-14/+201
| | | | * Convert zone info type to heap type and add it to module state * Add global variables to module state
* gh-101277: Finalise isolating itertools (GH-101305)Erlend E. Aasland2023-02-101-3/+3
| | | | | Add repeat, islice, chain, tee, teedataobject, and batched types to module state. Automerge-Triggered-By: GH:erlend-aasland
* gh-101277: Port more itertools static types to heap types (#101304)Erlend E. Aasland2023-02-081-3/+3
| | | | Add accumulate, compress, count, filterfalse, pairwise, product, and zip_longest types to module state.
* gh-101196: Make isdir/isfile/exists faster on Windows (GH-101324)Michael Droettboom2023-02-081-1/+253
| | | Co-authored-by: Eryk Sun <eryksun@gmail.com>
* Revert "gh-89381: Fix invalid signatures of math/cmath.log (#101404)" (#101580)Mark Dickinson2023-02-052-24/+29
| | | This reverts commit 0ef92d979311ba82d4c41b22ef38e12e1b08b13d.
* gh-101277: Port more `itertools` static types to heap types (#101303)Erlend E. Aasland2023-02-031-5/+5
| | | Add dropwhile, takewhile, starmap, combinations*, and permutations types to module state.
* gh-101277: Isolate itertools, add group and _grouper types to module state ↵Erlend E. Aasland2023-02-011-4/+4
| | | | | (#101302) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* gh-101409: Improve generated clinic code for self type checks (#101411)Erlend E. Aasland2023-01-315-39/+36
|
* gh-89381: Fix invalid signatures of math/cmath.log (#101404)Sergey B Kirpichev2023-01-292-29/+24
|
* gh-92123: Adapt _elementtree to multi-phase init (PEP 489) (#101285)Erlend E. Aasland2023-01-241-48/+161
|
* GH-92123: Move _elementtree heap types to module state (#101187)Erlend E. Aasland2023-01-211-7/+7
|
* gh-92123: Convert `_elementtree` types to heap types (#99221)Erlend E. Aasland2023-01-201-7/+7
|
* GH-100485: Add math.sumprod() (GH-100677)Raymond Hettinger2023-01-071-1/+38
|
* GH-100342: check for allocation failure in AC `*args` parsing (#100343)Kumar Aditya2022-12-281-1/+7
|
* gh-100344: Add C implementation for `asyncio.current_task` (#100345)Itamar Ostricher2022-12-221-1/+61
| | | Co-authored-by: pranavtbhat
* GH-69564: Clarify use of octal format of mode argument in help(os.chmod) ↵amaajemyfren2022-12-211-1/+12
| | | | | (#20621) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* GH-98363: Have batched() return tuples (GH-100118)Raymond Hettinger2022-12-081-7/+7
|
* gh-93453: No longer create an event loop in get_event_loop() (#98440)Serhiy Storchaka2022-12-061-63/+1
| | | | | | | | | | | | | | | asyncio.get_event_loop() now always return either running event loop or the result of get_event_loop_policy().get_event_loop() call. The latter should now raise an RuntimeError if no current event loop was set instead of creating and setting a new event loop. It affects also a number of asyncio functions and constructors which call get_event_loop() implicitly: ensure_future(), shield(), gather(), etc. DeprecationWarning is no longer emitted if there is no running event loop but the current event loop was set. Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* bpo-15999: Accept arbitrary values for boolean parameters. (#15609)Serhiy Storchaka2022-12-038-96/+96
| | | builtins and extension module functions and methods that expect boolean values for parameters now accept any Python object rather than just a bool or int type. This is more consistent with how native Python code itself behaves.
* gh-99845: Use size_t type in __sizeof__() methods (#99846)Victor Stinner2022-11-302-14/+14
| | | | | | | | 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).
* GH-91375: Port `_asyncio` static types to heap types and module state (#99122)Kumar Aditya2022-11-291-30/+145
| | | | Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* bpo-40882: Fix a memory leak in SharedMemory on Windows (GH-20684)Zackery Spytz2022-11-251-1/+27
| | | | | In multiprocessing.shared_memory.SharedMemory(), the temporary view returned by MapViewOfFile() should be unmapped when it is no longer needed.
* gh-64490: Fix bugs in argument clinic varargs processing (#32092)colorfulappl2022-11-241-1/+389
|
* gh-99240: Fix double-free bug in Argument Clinic str_converter generated ↵colorfulappl2022-11-241-1/+71
| | | | | | | | code (GH-99241) Fix double-free bug mentioned at https://github.com/python/cpython/issues/99240, by moving memory clean up out of "exit" label. Automerge-Triggered-By: GH:erlend-aasland
* gh-64490: Fix refcount error when arguments are packed to tuple in argument ↵colorfulappl2022-11-241-1/+66
| | | | clinic (#99233)
* gh-99547: Add isjunction methods for checking if a path is a junction (GH-99548)Charles Machalow2022-11-221-1/+33
|
* gh-96002: Add functional test for Argument Clinic (#96178)colorfulappl2022-11-211-0/+2291
| | | | Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* gh-87092: expose the compiler's codegen to python for unit tests (GH-99111)Irit Katriel2022-11-141-1/+64
|
* gh-98930: improve the docstring of signal.strsignal (#99290)ram vikram singh2022-11-131-3/+4
| | | | | | | Improves the docstring on signal.strsignal to make it explain when it returns a message, None, or when it raises ValueError. Closes #98930 Co-authored-by: Gregory P. Smith <greg@krypto.org>
* gh-98793: Fix typecheck in `overlapped.c` (#98835)Charlie Zhao2022-10-301-1/+9
| | | | Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* gh-95023: Added os.setns and os.unshare functions (#95046)Noam Cohen2022-10-201-1/+150
| | | | | | | | Added os.setns and os.unshare to easily switch between namespaces on Linux. Co-authored-by: Christian Heimes <christian@python.org> Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM> Co-authored-by: Victor Stinner <vstinner@python.org>
* GH-98363: Add itertools.batched() (GH-98364)Raymond Hettinger2022-10-171-1/+80
|
* gh-95534: Improve gzip reading speed by 10% (#97664)Ruben Vorderman2022-10-171-1/+99
| | | | | | | | | Change summary: + There is now a `gzip.READ_BUFFER_SIZE` constant that is 128KB. Other programs that read in 128KB chunks: pigz and cat. So this seems best practice among good programs. Also it is faster than 8 kb chunks. + a zlib._ZlibDecompressor was added. This is the _bz2.BZ2Decompressor ported to zlib. Since the zlib.Decompress object is better for in-memory decompression, the _ZlibDecompressor is hidden. It only makes sense in file decompression, and that is already implemented now in the gzip library. No need to bother the users with this. + The ZlibDecompressor uses the older Cpython arrange_output_buffer functions, as those are faster and more appropriate for the use case. + GzipFile.read has been optimized. There is no longer a `unconsumed_tail` member to write back to padded file. This is instead handled by the ZlibDecompressor itself, which has an internal buffer. `_add_read_data` has been inlined, as it was just two calls. EDIT: While I am adding improvements anyway, I figured I could add another one-liner optimization now to the python -m gzip application. That read chunks in io.DEFAULT_BUFFER_SIZE previously, but has been updated now to use READ_BUFFER_SIZE chunks.
* gh-95011: Migrate syslog module to Argument Clinic (GH-95012)Noam Cohen2022-10-081-0/+257
|
* gh-96288: Add a sentence to `os.mkdir`'s docstring. (#96271)Hagai Helman Tov2022-10-071-2/+3
|
* gh-97955: Migrate `zoneinfo` to Argument Clinic (#97958)Nikita Sobolev2022-10-071-0/+188
|
* gh-64373: Convert `_functools` to Argument Clinic (#96640)Nikita Sobolev2022-10-071-0/+104
|
* GH-96704: Add {Task,Handle}.get_context(), use it in ↵Guido van Rossum2022-10-051-1/+18
| | | | | call_exception_handler() (#96756) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* gh-97728: Argument Clinic: Fix uninitialized variable in the Py_UNICODE ↵Serhiy Storchaka2022-10-033-14/+14
| | | | | | | converter (GH-97729) It affects function os.system() on Windows and Windows-specific modules winreg, _winapi, _overlapped, and _msi.
* GH-78724: Initialize struct.Struct in __new__ (GH-94532)Kumar Aditya2022-09-251-8/+8
| | | | Closes https://github.com/python/cpython/issues/75960 Closes https://github.com/python/cpython/issues/78724
* gh-93678: add _testinternalcapi.optimize_cfg() and test utils for compiler ↵Irit Katriel2022-08-241-0/+68
| | | | optimization unit tests (GH-96007)
* gh-90928: Improve static initialization of keywords tuple in AC (#95907)Erlend E. Aasland2022-08-1337-4137/+1609
|
* gh-90928: Statically Initialize the Keywords Tuple in Clinic-Generated Code ↵Eric Snow2022-08-1161-291/+8247
| | | | | | | | | | | | | | | | (gh-95860) We only statically initialize for core code and builtin modules. Extension modules still create the tuple at runtime. We'll solve that part of interpreter isolation separately. This change includes generated code. The non-generated changes are in: * Tools/clinic/clinic.py * Python/getargs.c * Include/cpython/modsupport.h * Makefile.pre.in (re-generate global strings after running clinic) * very minor tweaks to Modules/_codecsmodule.c and Python/Python-tokenize.c All other changes are generated code (clinic, global strings).
* gh-91323: Revert "Allow overriding a future compliance check in asyncio.Task ↵Łukasz Langa2022-08-041-38/+1
| | | | | | (GH-32197)" (GH-95442) This reverts commit d4bb38f82bf18b00db3129031ce4969b6f0caab9.
* gh-95417: Quick fix for "ULONG_PTR differs in levels of indirection from ↵Oleg Iarygin2022-08-011-3/+3
| | | | void *" (GH-95538)
* gh-94512: Fix forced arg format in AC-processed resource (GH-94515)Oleg Iarygin2022-07-291-24/+25
|
* gh-94512: Fix forced arg format in AC-processed overlapped (GH-94516)Oleg Iarygin2022-07-281-53/+318
|