summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* bpo-41867: List options for timespec in docstrings of isoformat methods ↵Ram Rachum2020-10-031-4/+8
| | | | (GH-22418)
* Update link to supporting references (GH-22488)Raymond Hettinger2020-10-021-1/+1
|
* bpo-26680: Incorporate is_integer in all built-in and standard library ↵Robert Smallshire2020-10-012-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | numeric types (GH-6121) * bpo-26680: Adds support for int.is_integer() for compatibility with float.is_integer(). The int.is_integer() method always returns True. * bpo-26680: Adds a test to ensure that False.is_integer() and True.is_integer() are always True. * bpo-26680: Adds Real.is_integer() with a trivial implementation using conversion to int. This default implementation is intended to reduce the workload for subclass implementers. It is not robust in the presence of infinities or NaNs and may have suboptimal performance for other types. * bpo-26680: Adds Rational.is_integer which returns True if the denominator is one. This implementation assumes the Rational is represented in it's lowest form, as required by the class docstring. * bpo-26680: Adds Integral.is_integer which always returns True. * bpo-26680: Adds tests for Fraction.is_integer called as an instance method. The tests for the Rational abstract base class use an unbound method to sidestep the inability to directly instantiate Rational. These tests check that everything works correct as an instance method. * bpo-26680: Updates documentation for Real.is_integer and built-ins int and float. The call x.is_integer() is now listed in the table of operations which apply to all numeric types except complex, with a reference to the full documentation for Real.is_integer(). Mention of is_integer() has been removed from the section 'Additional Methods on Float'. The documentation for Real.is_integer() describes its purpose, and mentions that it should be overridden for performance reasons, or to handle special values like NaN. * bpo-26680: Adds Decimal.is_integer to the Python and C implementations. The C implementation of Decimal already implements and uses mpd_isinteger internally, we just expose the existing function to Python. The Python implementation uses internal conversion to integer using to_integral_value(). In both cases, the corresponding context methods are also implemented. Tests and documentation are included. * bpo-26680: Updates the ACKS file. * bpo-26680: NEWS entries for int, the numeric ABCs and Decimal. Co-authored-by: Robert Smallshire <rob@sixty-north.com>
* bpo-41861: Convert _sqlite3 CursorType and ConnectionType to heap types ↵Erlend Egeberg Aasland2020-10-016-102/+74
| | | | (GH-22478)
* bpo-41861: Convert _sqlite3 RowType and StatementType to heap types (GH-22444)Erlend Egeberg Aasland2020-10-019-118/+71
|
* bpo-41861: Convert _sqlite3 PrepareProtocolType to heap type (GH-22428)Erlend Egeberg Aasland2020-09-285-54/+33
|
* bpo-41842: Add codecs.unregister() function (GH-22360)Hai Shi2020-09-282-1/+34
| | | | Add codecs.unregister() and PyCodec_Unregister() functions to unregister a codec search function.
* bpo-41861: Convert _sqlite3 cache and node static types to heap types (GH-22417)Erlend Egeberg Aasland2020-09-274-99/+48
|
* bpo-1635741: Port _bisect module to multi-phase init (GH-22415)Dong-hee Na2020-09-261-9/+5
|
* bpo-30155: Add macros to get tzinfo from datetime instances (GH-21633)Zackery Spytz2020-09-233-13/+8
| | | | Add PyDateTime_DATE_GET_TZINFO() and PyDateTime_TIME_GET_TZINFO() macros.
* bpo-40170: Use inline _PyType_HasFeature() function (GH-22375)Victor Stinner2020-09-231-1/+2
| | | | | Use _PyType_HasFeature() in the _io module and in structseq implementation. Replace PyType_HasFeature() opaque function call with _PyType_HasFeature() inlined function.
* bpo-1635741, unicodedata: add ucd_type parameter to UCD_Check() macro (GH-22328)Mohamed Koubaa2020-09-231-13/+16
| | | Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-1635741: Port _lsprof extension to multi-phase init (PEP 489) (GH-22220)Mohamed Koubaa2020-09-232-99/+137
|
* bpo-41513: Improve order of adding fractional values. Improve variable ↵Raymond Hettinger2020-09-231-12/+12
| | | | names. (GH-22368)
* bpo-41602: raise SIGINT exit code on KeyboardInterrupt from ↵Thomas Grainger2020-09-221-0/+4
| | | | | pymain_run_module (#21956) Closes bpo issue 41602
* bpo-1635741: Convert an _lsprof method to argument clinic (GH-22240)Mohamed Koubaa2020-09-212-31/+86
|
* bpo-12178: Fix escaping of escapechar in csv.writer() (GH-13710)Berker Peksag2020-09-201-0/+3
| | | Co-authored-by: Itay Elbirt <anotahacou@gmail.com>
* bpo-41815: SQLite: segfault if backup called on closed database (GH-22322)Peter McCormick2020-09-201-0/+4
| | | | | | | | | | | | | # [bpo-41815](): SQLite: fix segfault if backup called on closed database Attempting to backup a closed database will trigger segfault: ```python import sqlite3 target = sqlite3.connect(':memory:') source = sqlite3.connect(':memory:') source.close() source.backup(target) ```
* bpo-41756: Introduce PyGen_Send C API (GH-22196)Vladimir Matveev2020-09-191-5/+22
| | | | | | | | | | | | | The new API allows to efficiently send values into native generators and coroutines avoiding use of StopIteration exceptions to signal returns. ceval loop now uses this method instead of the old "private" _PyGen_Send C API. This translates to 1.6x increased performance of 'await' calls in micro-benchmarks. Aside from CPython core improvements, this new API will also allow Cython to generate more efficient code, benefiting high-performance IO libraries like uvloop.
* Make fractional value accumulation consistent inside and outside the loop. ↵Raymond Hettinger2020-09-191-5/+4
| | | | (GH-22315)
* bpo-41662: Fix bugs in binding parameters in sqlite3 (GH-21998)Serhiy Storchaka2020-09-171-2/+5
| | | | | | | * When the parameters argument is a list, correctly handle the case of changing it during iteration. * When the parameters argument is a custom sequence, no longer override an exception raised in ``__len__()``.
* bpo-41513: Add docs and tests for hypot() (GH-22238)Raymond Hettinger2020-09-141-7/+7
|
* bpo-1635741: Port cmath to multi-phase init (PEP 489) (GH-22165)Mohamed Koubaa2020-09-101-30/+48
|
* bpo-41687: Fix error handling in Solaris sendfile implementation (GH-22128)Jakub Kulík2020-09-091-3/+2
| | | | | | | I just realized that my recent PR with sendfile on Solaris ([PR 22040](https://github.com/python/cpython/pull/22040)) has broken error handling. Sorry for that, this simple followup fixes that. Automerge-Triggered-By: @1st1
* bpo-1635741: port scproxy to multi-phase init (GH-22164)Mohamed Koubaa2020-09-091-13/+9
|
* bpo-1635741: Convert _sha256 types to heap types (GH-22134)Mohamed Koubaa2020-09-082-103/+126
| | | Convert the _sha256 extension module types to heap types.
* bpo-1635741: Port the termios to multi-phase init (PEP 489) (GH-22139)Mohamed Koubaa2020-09-081-81/+101
|
* bpo-40744: Drop support for SQLite pre 3.7.3 (GH-20909)Erlend Egeberg Aasland2020-09-072-66/+16
| | | | | | Remove code required to support SQLite pre 3.7.3. Co-written-by: Berker Peksag <berker.peksag@gmail.com> Co-written-by: Sergey Fedoseev <fedoseev.sergey@gmail.com>
* bpo-1635741 port _curses_panel to multi-phase init (PEP 489) (GH-21986)Mohamed Koubaa2020-09-072-155/+271
|
* bpo-1635741: Port _overlapped module to multi-phase init (GH-22051)Mohamed Koubaa2020-09-071-67/+106
| | | Port the _overlapped extension module to multi-phase initialization (PEP 489).
* bpo-1635741: Port _opcode module to multi-phase init (PEP 489) (GH-22050)Mohamed Koubaa2020-09-071-14/+7
|
* bpo-1635741 port zlib module to multi-phase init (GH-21995)Mohamed Koubaa2020-09-072-252/+362
| | | Port the zlib extension module to multi-phase initialization (PEP 489).
* bpo-41513: Expand comments and add references for a better understanding ↵Raymond Hettinger2020-09-061-5/+21
| | | | (GH-22123)
* bpo-1635741: Port _sha1, _sha512, _md5 to multiphase init (GH-21818)Mohamed Koubaa2020-09-066-251/+357
| | | | Port the _sha1, _sha512, and _md5 extension modules to multi-phase initialization API (PEP 489).
* bpo-40318: Migrate to SQLite3 trace v2 API (GH-19581)Erlend Egeberg Aasland2020-09-051-0/+36
| | | | | Ref. https://sqlite.org/c3ref/trace_v2.html Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-41687: Fix sendfile implementation to work with Solaris (#22040)Jakub Kulík2020-09-051-0/+19
|
* bpo-41638: Improve ProgrammingError message for absent parameter. (GH-21999)Serhiy Storchaka2020-09-041-1/+1
| | | | | It contains now the name of the parameter instead of its index when parameters are supplied as a dict.
* bpo-41713: _signal doesn't use multi-phase init (GH-22087)Victor Stinner2020-09-041-7/+13
| | | | | Partially revert commit 71d1bd9569c8a497e279f2fea6fe47cd70a87ea3: don't use multi-phase initialization (PEP 489) for the _signal extension module.
* bpo-1635741: Port _signal module to multi-phase init (PEP 489) (GH-22049)Mohamed Koubaa2020-09-031-82/+86
|
* closes bpo-41689: Preserve text signature from tp_doc in C heap type ↵Benjamin Peterson2020-09-021-0/+30
| | | | creation. (GH-22058)
* bpo-41675: Modernize siginterrupt calls (GH-22028)Pablo Galindo2020-09-021-1/+13
| | | | | | siginterrupt is deprecated: ./Modules/signalmodule.c:667:5: warning: ‘siginterrupt’ is deprecated: Use sigaction with SA_RESTART instead [-Wdeprecated-declarations] 667 | if (siginterrupt(signalnum, flag)<0) {
* bpo-1635741: Port _sha3 module to multi-phase init (GH-21855)Mohamed Koubaa2020-09-021-136/+193
| | | | Port the _sha3 extension module to multi-phase init (PEP 489). Convert static types to heap types.
* bpo-1635741: Port _blake2 module to multi-phase init (GH-21856)Mohamed Koubaa2020-09-023-118/+118
| | | | Port the _blake2 extension module to the multi-phase initialization API (PEP 489).
* Improve hypot() accuracy with three separate accumulators (GH-22032)Raymond Hettinger2020-09-021-4/+4
|
* Further improve accuracy of math.hypot() (GH-22013)Raymond Hettinger2020-08-301-3/+8
|
* bpo-41513: Save unnecessary steps in the hypot() calculation (#21994)Raymond Hettinger2020-08-291-5/+10
|
* Fix typos in comment (GH-21966)Raymond Hettinger2020-08-261-2/+2
|
* bpo-40077: Convert _operator to use PyType_FromSpec (GH-21954)Dong-hee Na2020-08-261-156/+142
|
* bpo-41513: More accurate hypot() (GH-21916)Raymond Hettinger2020-08-251-37/+111
|
* bpo-41568: Fix refleaks in zoneinfo subclasses (GH-21907)Paul Ganssle2020-08-171-3/+3
| | | | | | | | | | | | | | * Fix refleak in C module __init_subclass__ This was leaking a reference to the weak cache dictionary for every ZoneInfo subclass created. * Fix refleak in ZoneInfo subclass's clear_cache The previous version of the code accidentally cleared the global ZONEINFO_STRONG_CACHE variable (and inducing `ZoneInfo` to create a new strong cache) on calls to a subclass's `clear_cache()`. This would not affect guaranteed behavior, but it's still not the right thing to do (and it caused reference leaks).