Raymond Hettinger
b104ecbbaf
Shorter docstring (GH-16322)
2019-09-21 12:57:44 -07:00
Ammar Askar
87d6cd3604
bpo-38237: Make pow's arguments have more descriptive names and be keyword passable (GH-16302)
...
Edit: `math.pow` changes removed on Mark's request.
https://bugs.python.org/issue38237
Automerge-Triggered-By: @rhettinger
2019-09-20 21:28:49 -07:00
Serhiy Storchaka
279f44678c
bpo-37206: Unrepresentable default values no longer represented as None. (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.
2019-09-14 12:24:05 +03:00
Serhiy Storchaka
88bdb9280b
bpo-36781: Optimize sum() for bools. ( #13074 )
...
* Optimize sum() for bools.
* Fix sum([], False).
* Add a NEWS entry.
2019-09-10 14:31:01 +01:00
Serhiy Storchaka
1f21eaa15e
bpo-15999: Clean up of handling boolean arguments. (GH-15610)
...
* Use the 'p' format unit instead of manually called PyObject_IsTrue().
* Pass boolean value instead 0/1 integers to functions that needs boolean.
* Convert some arguments to boolean only once.
2019-09-01 12:16:51 +03:00
Serhiy Storchaka
41c57b3353
bpo-37994: Fix silencing all errors if an attribute lookup fails. (GH-15630)
...
Only AttributeError should be silenced.
2019-09-01 12:03:39 +03:00
Sergey Fedoseev
6a650aaf77
bpo-37976: Prevent shadowing of TypeError in zip() (GH-15592)
2019-08-29 21:25:48 -07:00
Sergey Fedoseev
af2f5b1723
Adjust builtins.zip() docstring to better communicate its signature (GH-14833)
2019-07-18 11:19:25 -07:00
Jeroen Demeyer
762f93ff2e
bpo-37337: Add _PyObject_CallMethodNoArgs() (GH-14267)
2019-07-08 17:19:25 +09:00
Jeroen Demeyer
196a530e00
bpo-37483: add _PyObject_CallOneArg() function ( #14558 )
2019-07-04 19:31:34 +09:00
Steve Dower
60419a7e96
bpo-37363: Add audit events for a range of modules (GH-14301)
2019-06-24 08:42:54 -07:00
Victor Stinner
b45d259bdd
bpo-36710: Use tstate in pylifecycle.c (GH-14249)
...
In pylifecycle.c: pass tstate argument, rather than interp argument,
to functions.
2019-06-20 00:05:23 +02:00
Victor Stinner
37d66d7d4b
bpo-37253: Add _PyCompilerFlags_INIT macro (GH-14018)
...
Add a new _PyCompilerFlags_INIT macro to initialize PyCompilerFlags
variables, rather than initializing cf_flags and cf_feature_version
explicitly in each variable.
2019-06-13 02:16:41 +02:00
Victor Stinner
efdf6ca90f
bpo-35766: compile(): rename feature_version parameter (GH-13994)
...
Rename compile() feature_version parameter to _feature_version and
convert it to a keyword-only parameter.
Update also test_type_comments to pass feature_version as a tuple.
2019-06-12 02:52:16 +02:00
Jeroen Demeyer
530f506ac9
bpo-36974: tp_print -> tp_vectorcall_offset and tp_reserved -> tp_as_async (GH-13464)
...
Automatically replace
tp_print -> tp_vectorcall_offset
tp_compare -> tp_as_async
tp_reserved -> tp_as_async
2019-05-30 19:13:39 -07:00
Jeroen Demeyer
aacc77fbd7
bpo-36974: implement PEP 590 (GH-13185)
...
Co-authored-by: Jeroen Demeyer <J.Demeyer@UGent.be >
Co-authored-by: Mark Shannon <mark@hotpy.org >
2019-05-29 20:31:52 +02:00
Dino Viehland
415406999d
bpo-37001: Makes symtable.symtable have parity with compile for input ( #13483 )
...
* Makes symtable.symtable have parity for accepted datatypes
for source code as compile()
* Add NEWS blurb
2019-05-28 16:21:17 -07:00
Victor Stinner
331a6a56e9
bpo-36763: Implement the PEP 587 (GH-13592)
...
* Add a whole new documentation page:
"Python Initialization Configuration"
* PyWideStringList_Append() return type is now PyStatus,
instead of int
* PyInterpreterState_New() now calls PyConfig_Clear() if
PyConfig_InitPythonConfig() fails.
* Rename files:
* Python/coreconfig.c => Python/initconfig.c
* Include/cpython/coreconfig.h => Include/cpython/initconfig.h
* Include/internal/: pycore_coreconfig.h => pycore_initconfig.h
* Rename structures
* _PyCoreConfig => PyConfig
* _PyPreConfig => PyPreConfig
* _PyInitError => PyStatus
* _PyWstrList => PyWideStringList
* Rename PyConfig fields:
* use_module_search_paths => module_search_paths_set
* module_search_path_env => pythonpath_env
* Rename PyStatus field: _func => func
* PyInterpreterState: rename core_config field to config
* Rename macros and functions:
* _PyCoreConfig_SetArgv() => PyConfig_SetBytesArgv()
* _PyCoreConfig_SetWideArgv() => PyConfig_SetArgv()
* _PyCoreConfig_DecodeLocale() => PyConfig_SetBytesString()
* _PyInitError_Failed() => PyStatus_Exception()
* _Py_INIT_ERROR_TYPE_xxx enums => _PyStatus_TYPE_xxx
* _Py_UnixMain() => Py_BytesMain()
* _Py_ExitInitError() => Py_ExitStatusException()
* _Py_PreInitializeFromArgs() => Py_PreInitializeFromBytesArgs()
* _Py_PreInitializeFromWideArgs() => Py_PreInitializeFromArgs()
* _Py_PreInitialize() => Py_PreInitialize()
* _Py_RunMain() => Py_RunMain()
* _Py_InitializeFromConfig() => Py_InitializeFromConfig()
* _Py_INIT_XXX() => _PyStatus_XXX()
* _Py_INIT_FAILED() => _PyStatus_EXCEPTION()
* Rename 'err' PyStatus variables to 'status'
* Convert RUN_CODE() macro to config_run_code() static inline function
* Remove functions:
* _Py_InitializeFromArgs()
* _Py_InitializeFromWideArgs()
* _PyInterpreterState_GetCoreConfig()
2019-05-27 16:39:22 +02:00
Steve Dower
b82e17e626
bpo-36842: Implement PEP 578 (GH-12613)
...
Adds sys.audit, sys.addaudithook, io.open_code, and associated C APIs.
2019-05-23 08:45:22 -07:00
Serhiy Storchaka
29500737d4
bpo-36791: Safer detection of integer overflow in sum(). (GH-13080)
2019-05-05 14:26:23 +03:00
Guido van Rossum
495da29225
bpo-35975: Support parsing earlier minor versions of Python 3 (GH-12086)
...
This adds a `feature_version` flag to `ast.parse()` (documented) and `compile()` (hidden) that allow tweaking the parser to support older versions of the grammar. In particular if `feature_version` is 5 or 6, the hacks for the `async` and `await` keyword from PEP 492 are reinstated. (For 7 or higher, these are unconditionally treated as keywords, but they are still special tokens rather than `NAME` tokens that the parser driver recognizes.)
https://bugs.python.org/issue35975
2019-03-07 12:38:08 -08:00
Sergey Fedoseev
f1b9abe35f
bpo-36030: Remove _PyStack_AsTuple() and _PyStack_AsTupleSlice() (GH-12032)
2019-02-25 22:37:26 +01:00
Serhiy Storchaka
a24107b04c
bpo-35459: Use PyDict_GetItemWithError() instead of PyDict_GetItem(). (GH-11112)
2019-02-25 17:59:46 +02:00
Guido van Rossum
dcfcd146f8
bpo-35766: Merge typed_ast back into CPython (GH-11645)
2019-01-31 12:40:27 +01:00
Serhiy Storchaka
7934266875
bpo-35582: Inline arguments tuple unpacking in handwritten code. (GH-11524)
...
Inline PyArg_UnpackTuple() and _PyArg_UnpackStack() in performance
sensitive code in the builtins and operator modules.
2019-01-12 08:25:41 +02:00