summaryrefslogtreecommitdiffstats
path: root/Objects/clinic
Commit message (Collapse)AuthorAgeFilesLines
* bpo-42431: Fix outdated bytes comments (GH-23458)Serhiy Storchaka2020-12-032-4/+4
| | | | Also move definitions of internal macros F_LJUST etc to private header.
* bpo-42246: Partial implementation of PEP 626. (GH-23113)Mark Shannon2020-11-121-13/+13
| | | * Implement new line number table format, as defined in PEP 626.
* bpo-42161: Use _PyLong_GetZero() and _PyLong_GetOne() (GH-22995)Victor Stinner2020-10-272-4/+4
| | | | Use _PyLong_GetZero() and _PyLong_GetOne() in Objects/ and Python/ directories.
* Revert "bpo-26680: Incorporate is_integer in all built-in and standard ↵Raymond Hettinger2020-10-071-19/+1
| | | | | library numeric types (GH-6121)" (GH-22584) This reverts commit 58a7da9e125422323f79c4ee95ac5549989d8162.
* bpo-26680: Incorporate is_integer in all built-in and standard library ↵Robert Smallshire2020-10-011-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-41342: Convert int.__round__ to Argument Clinic (GH-21549)Serhiy Storchaka2020-07-201-1/+35
|
* bpo-41334: Convert constructors of str, bytes and bytearray to Argument ↵Serhiy Storchaka2020-07-203-3/+210
| | | | Clinic (GH-21535)
* bpo-41343: Convert methods of complex to Argument Clinic (GH-21550)Dong-hee Na2020-07-201-1/+68
|
* bpo-41333: Convert OrderedDict.pop() to Argument Clinic (GH-21534)Serhiy Storchaka2020-07-192-3/+47
|
* bpo-41262: Convert memoryview to Argument Clinic. (GH-21421)Serhiy Storchaka2020-07-181-1/+193
|
* bpo-41263: Convert code.__new__ to Argument Clinic (GH-21426)Serhiy Storchaka2020-07-101-1/+137
|
* bpo-29882: Add an efficient popcount method for integers (#771)Niklas Fiekas2020-05-291-1/+26
| | | | | | | | | | | | | | | | | | | | | | | * bpo-29882: Add an efficient popcount method for integers * Update 'sign bit' and versionadded in docs * Add entry to whatsnew document * Doc: use positive example, mention population count * Minor cleanups of the core code * Move popcount_digit closer to where it's used * Use z instead of self after conversion * Add 'absolute value' and 'population count' to docstring * Fix clinic error about missing summary line * Ensure popcount_digit is portable with 64-bit ints Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
* bpo-40792: Make the result of PyNumber_Index() always having exact type int. ↵Serhiy Storchaka2020-05-285-23/+23
| | | | | | | | | | | | (GH-20443) Previously, the result could have been an instance of a subclass of int. Also revert bpo-26202 and make attributes start, stop and step of the range object having exact type int. Add private function _PyNumber_Index() which preserves the old behavior of PyNumber_Index() for performance to use it in the conversion functions like PyLong_AsLong().
* bpo-37999: No longer use __int__ in implicit integer conversions. (GH-15636)Serhiy Storchaka2020-05-268-183/+8
| | | | Only __index__ should be used to make integer conversions lossless.
* bpo-39939: Add str.removeprefix and str.removesuffix (GH-18939)sweeneyde2020-04-223-3/+233
| | | | | Added str.removeprefix and str.removesuffix methods and corresponding bytes, bytearray, and collections.UserString methods to remove affixes from a string if present. See PEP 616 for a full description.
* bpo-39573: Update clinic to use Py_IS_TYPE() function (GH-18507)Dong-hee Na2020-02-141-2/+2
|
* Document CodeType.replace (GH-17776)Anthony Sottile2020-01-011-2/+2
|
* bpo-38629: implement __floor__ and __ceil__ for float type (GH-16985)Batuhan Taşkaya2019-12-151-1/+37
|
* bpo-38409: Fix grammar in str.strip() docstring (GH-16682)Zachary Ware2019-10-091-2/+2
|
* bpo-37206: Unrepresentable default values no longer represented as None. ↵Serhiy Storchaka2019-09-146-15/+15
| | | | | | | (GH-13933) In ArgumentClinic, value "NULL" should now be used only for unrepresentable default values (like in the optional third parameter of getattr). "None" should be used if None is accepted as argument and passing None has the same effect as not passing the argument at all.
* bpo-37034: Display argument name on errors with keyword arguments with ↵Rémi Lapeyre2019-08-299-52/+52
| | | | Argument Clinic. (GH-13593)
* Improve docstring of list.sort (GH-8516)Tim Hoffmann2019-06-011-2/+10
|
* bpo-22385: Support output separators in hex methods. (#13578)Gregory P. Smith2019-05-293-2/+214
| | | | | | | | | | | | | | | | | | * bpo-22385: Support output separators in hex methods. Also in binascii.hexlify aka b2a_hex. The underlying implementation behind all hex generation in CPython uses the same pystrhex.c implementation. This adds support to bytes, bytearray, and memoryview objects. The binascii module functions exist rather than being slated for deprecation because they return bytes rather than requiring an intermediate step through a str object. This change was inspired by MicroPython which supports sep in its binascii implementation (and does not yet support the .hex methods). https://bugs.python.org/issue22385
* bpo-37032: Add CodeType.replace() method (GH-13542)Victor Stinner2019-05-241-0/+256
|
* bpo-20180: Use argument clinic for dict.pop() and dict.popitem() (GH-12792)Inada Naoki2019-04-121-1/+58
|
* bpo-36127: Argument Clinic: inline parsing code for keyword parameters. ↵Serhiy Storchaka2019-03-1412-102/+704
| | | | (GH-12058)
* bpo-35582: Argument Clinic: Optimize the "all boring objects" case. (GH-11520)Serhiy Storchaka2019-01-118-59/+109
| | | | | Use _PyArg_CheckPositional() and inlined code instead of PyArg_UnpackTuple() and _PyArg_UnpackStack() if all parameters are positional and use the "object" converter.
* bpo-35582: Argument Clinic: inline parsing code for positional parameters. ↵Serhiy Storchaka2019-01-118-51/+412
| | | | (GH-11313)
* bpo-23867: Argument Clinic: inline parsing code for a single positional ↵Serhiy Storchaka2018-12-256-19/+87
| | | | parameter. (GH-9689)
* bpo-33012: Fix invalid function cast warnings with gcc 8 in Argument Clinic. ↵Serhiy Storchaka2018-11-279-61/+61
| | | | | | | | (GH-6748) Fix invalid function cast warnings with gcc 8 for method conventions different from METH_NOARGS, METH_O and METH_VARARGS in Argument Clinic generated code.
* bpo-33462: Add __reversed__ to dict and dict views (GH-6827)Rémi Lapeyre2018-11-061-1/+19
|
* Add missing closing quote and trailing period in str.isidentifier() ↵Emanuele Gaifas2018-10-081-2/+2
| | | | | docstring (GH-9756) This rectifies commit ffc5a14d00db984c8e72c7b67da8a493e17e2c14.
* bpo-33014: Clarify str.isidentifier docstring (GH-6088)Sanyam Khurana2018-10-081-3/+3
| | | | | | * bpo-33014: Clarify str.isidentifier docstring * bpo-33014: Add code example in isidentifier documentation
* bpo-33073: Adding as_integer_ratio to ints. (GH-8750)Lisa Roach2018-09-141-1/+29
|
* bpo-32677: Add .isascii() to str, bytes and bytearray (GH-5342)INADA Naoki2018-01-271-1/+22
|
* bpo-32240: Add the const qualifier to declarations of PyObject* array ↵Serhiy Storchaka2017-12-159-61/+61
| | | | arguments. (#4746)
* bpo-20047: Make bytearray methods partition() and rpartition() rejecting (#4158)Serhiy Storchaka2017-10-283-12/+13
| | | separators that are not bytes-like objects.
* bpo-29464: Rename METH_FASTCALL to METH_FASTCALL|METH_KEYWORDS and make (#1955)Serhiy Storchaka2017-07-039-181/+61
| | | | | the bare METH_FASTCALL be used for functions with positional-only parameters.
* bpo-30600: Fix error messages (condition order in Argument Clinic) (#2051)Sylvain2017-06-107-110/+110
| | | | | | | | The function '_PyArg_ParseStack()' and '_PyArg_UnpackStack' were failing (with error "XXX() takes Y argument (Z given)") before the function '_PyArg_NoStackKeywords()' was called. Thus, the latter did not raise its more meaningful error : "XXX() takes no keyword arguments".
* bpo-29914: Fix default implementations of __reduce__ and __reduce_ex__(). (#843)Serhiy Storchaka2017-04-081-30/+11
| | | | object.__reduce__() no longer takes arguments, object.__reduce_ex__() now requires one argument.
* Update Argument Clinic generated code for bpo-29878. (#1001)Serhiy Storchaka2017-04-052-4/+4
|
* bpo-29935: Fixed error messages in the index() method of tuple, list and ↵Serhiy Storchaka2017-03-302-4/+4
| | | | | deque (#887) when pass indices of wrong type.
* bpo-29793: Convert some builtin types constructors to Argument Clinic. (#615)Serhiy Storchaka2017-03-197-2/+282
|
* bpo-20186: Convert tuple object implementation to Argument Clinic. (#614)Serhiy Storchaka2017-03-191-0/+102
|
* bpo-20185: Convert typeobject.c to Argument Clinic. (#544)Serhiy Storchaka2017-03-191-0/+259
| | | Based on patch by Vajrasky Kok.
* bpo-20185: Convert float object implementation to Argument Clinic. (#543)Serhiy Storchaka2017-03-111-0/+286
| | | Based on patch by Vajrasky Kok.
* bpo-20185: Convert list object implementation to Argument Clinic. (#542)Serhiy Storchaka2017-03-111-0/+300
|
* Issue #29311: Regenerate Argument Clinic.Serhiy Storchaka2017-02-041-2/+2
|
* Issue #20185: Converted the int class to Argument Clinic.Serhiy Storchaka2017-02-011-0/+192
| | | | Based on patch by Vajrasky Kok.
* Issues #29311, #29289: Fixed and improved docstrings for dict and OrderedDictSerhiy Storchaka2017-01-242-14/+15
| | | | methods.