summaryrefslogtreecommitdiff
path: root/Python/bltinmodule.c
AgeCommit message (Collapse)AuthorLines
2018-08-24closes bpo-34474: Python/bltinmodule.c: Add missing NULL check in ↵Miss Islington (bot)-0/+5
builtin_sum_impl() (GH-8872) Reported by Svace static analyzer. (cherry picked from commit 2b824b2538c4a5f9f520c5de8a1eae5a0c181a94) Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
2018-02-02bpo-32674: Improve the docstring for __import__ (GH-5339) (GH-5489)Miss Islington (bot)-3/+3
Clarify that the level argument is used to determine whether to perform absolute or relative imports: 0 is absolute, while a positive number is the number of parent directories to search relative to the current module. (cherry picked from commit 461d225b195eec5269f317323b41115516144c41) Co-authored-by: oldk <oldk1331@users.noreply.github.com>
2017-09-28[3.6] bpo-31588: Validate return value of __prepare__() methods (GH-3790)Miss Islington (bot)-0/+7
Class execution requires that __prepare__() methods return a proper execution namespace. Check for that immediately after calling __prepare__(), rather than passing it through to the code execution machinery and potentially triggering SystemError (in debug builds) or a cryptic TypeError (in release builds). Patch by Oren Milman. (cherry picked from commit 5837d0418f47933b2e3c139bdee8a79c248a943c)
2017-09-11[3.6] bpo-29526: Add reference to help('FORMATTING') in format() builtin ↵Serhiy Storchaka-2/+4
(GH-166). (#3491) (cherry picked from commit 2e6bb4484ee1b0da67d1dfcf0816c58602daa5a0)
2017-03-12[3.6] bpo-8256: Fixed possible failing or crashing input() (#641)Serhiy Storchaka-5/+16
if attributes "encoding" or "errors" of sys.stdin or sys.stdout are not set or are not strings.
2017-01-23Issue #26729: Fixed __text_signature__ for sorted().Serhiy Storchaka-1/+1
Patch by Erik Welch.
2017-01-23Issue #26729: Fixed __text_signature__ for sorted().Serhiy Storchaka-1/+1
Patch by Erik Welch.
2017-01-20Issue #29327: Fixed a crash when pass the iterable keyword argument to sorted().Serhiy Storchaka-1/+2
2016-12-05Issue #23722: improve __classcell__ compatibilityNick Coghlan-5/+35
Handling zero-argument super() in __init_subclass__ and __set_name__ involved moving __class__ initialisation to type.__new__. This requires cooperation from custom metaclasses to ensure that the new __classcell__ entry is passed along appropriately. The initial implementation of that change resulted in abruptly broken zero-argument super() support in metaclasses that didn't adhere to the new requirements (such as Django's metaclass for Model definitions). The updated approach adopted here instead emits a deprecation warning for those cases, and makes them work the same way they did in Python 3.5. This patch also improves the related class machinery documentation to cover these details and to include more reader-friendly cross-references and index entries.
2016-11-20Replaced outdated macros _PyUnicode_AsString and _PyUnicode_AsStringAndSizeSerhiy Storchaka-4/+4
with PyUnicode_AsUTF8 and PyUnicode_AsUTF8AndSize.
2016-09-11Issue #23722: Initialize __class__ from type.__new__()Nick Coghlan-6/+4
The __class__ cell used by zero-argument super() is now initialized from type.__new__ rather than __build_class__, so class methods relying on that will now work correctly when called from metaclass methods during class creation. Patch by Martin Teichmann.
2016-09-08Issue #24254: Drop cls.__definition_order__.Eric Snow-1/+1
2016-09-03Issue 27936: Fix inconsistent round() behavior between float and intRaymond Hettinger-1/+1
2016-09-08Issue #27781: Change file system encoding on Windows to UTF-8 (PEP 529)Steve Dower-3/+5
2016-09-05Avoid calling functions with an empty string as format stringVictor Stinner-6/+6
Directly pass NULL rather than an empty string.
2016-09-05Issue #24254: Preserve class attribute definition order.Eric Snow-1/+1
2016-09-03MergeRaymond Hettinger-1/+1
2016-08-25MergeRaymond Hettinger-2/+2
2016-08-25Issue 19504: Change "customise" to "customize" American spelling.Raymond Hettinger-2/+2
2016-08-25Use Py_ssize_t type for number of argumentsVictor Stinner-1/+1
Issue #27848: use Py_ssize_t rather than C int for the number of function positional and keyword arguments.
2016-08-24Issue #27809: map_next() uses fast callVictor Stinner-15/+31
Use a small stack allocated in the C stack for up to 5 iterator functions, otherwise allocates a stack on the heap memory.
2016-08-24Backed out changeset 70f88b097f60 (map_next)Victor Stinner-31/+15
2016-08-23Issue #27809: map_next() uses fast callVictor Stinner-15/+31
Use a small stack allocated in the C stack for up to 5 iterator functions, otherwise allocates a stack on the heap memory.
2016-08-23Issue #27809: builtin___build_class__() uses fast callVictor Stinner-6/+2
2016-08-22Issue #27809: Use _PyObject_FastCallDict()Victor Stinner-10/+2
Modify: * init_subclass() * builtin___build_class__() Fix also a bug in init_subclass(): check for super() failure.
2016-08-22Issue #27809: Use _PyObject_FastCallDict()Victor Stinner-10/+5
Modify: * builtin_sorted() * classmethoddescr_call() * methoddescr_call() * wrapperdescr_call()
2016-07-07- Issue #27332: Fixed the type of the first argument of module-level functionsSerhiy Storchaka-59/+58
generated by Argument Clinic. Patch by Petr Viktorin.
2016-07-07Issue #27332: Fixed the type of the first argument of module-level functionsSerhiy Storchaka-59/+58
generated by Argument Clinic. Patch by Petr Viktorin.
2016-06-18Issue #27342: Replaced some Py_XDECREFs with Py_DECREFs.Serhiy Storchaka-2/+2
Patch by Xiang Zhang.
2016-05-05Restored parameter name "self" since gdb needs exact specific parameter names.Serhiy Storchaka-2/+3
2016-05-02Got rid of redundand "self" parameter declarations.Serhiy Storchaka-3/+2
Argument Clinic is now able to infer all needed information.
2016-05-01Regenerate Argument Clinic code for issue #26874.Serhiy Storchaka-1/+1
2016-05-01Regenerate Argument Clinic code for issue #26874.Serhiy Storchaka-1/+1
2016-04-28Closes #26874: Merge with 3.5Zachary Ware-1/+1
2016-04-28Issue #26874: Simplify the divmod docstringZachary Ware-1/+1
2016-04-28Closes #26874: Merge with 3.5Zachary Ware-1/+1
2016-04-28Issue #26874: Fix divmod docstringZachary Ware-1/+1
2016-04-13Issue #26057: Got rid of nonneeded use of PyUnicode_FromObject().Serhiy Storchaka-3/+2
2015-11-07Issue #24802: Merge null termination fixes from 3.5Martin Panter-16/+32
2015-11-07Issue #24802: Merge null termination fixes from 3.4 into 3.5Martin Panter-16/+32
2015-11-07Issue #24802: Copy bytes-like objects to null-terminated buffers if necessaryMartin Panter-16/+32
This avoids possible buffer overreads when int(), float(), compile(), exec() and eval() are passed bytes-like objects. Similar code is removed from the complex() constructor, where it was not reachable. Patch by John Leitch, Serhiy Storchaka and Martin Panter.
2015-10-10Issue #24402: Merge input() fix from 3.5Martin Panter-1/+3
2015-10-10Issue #24402: Merge input() fix from 3.4 into 3.5Martin Panter-1/+3
2015-10-10Issue #24402: Fix input() when stdout.fileno() fails; diagnosed by EryksunMartin Panter-1/+3
Also factored out some test cases into a new PtyTests class.
2015-10-09Hoist constant expression out of the inner loop.Raymond Hettinger-3/+3
2015-10-09Make comparison more consistentRaymond Hettinger-1/+1
2015-08-18Use PyTuple_GET_SIZE like the adjacent code does.Raymond Hettinger-1/+1
2015-08-18Inline PyIter_Next() matching the other itertools code.Raymond Hettinger-1/+2
2015-05-30Specify default values of semantic booleans in Argument Clinic generated ↵Serhiy Storchaka-4/+4
signatures as booleans.
2015-05-30Use converter names instead of format units in Argument Clinic descriptionsSerhiy Storchaka-72/+72
in builtin and _crypt modules.