Commit Graph

2663 Commits

Author SHA1 Message Date
Alexander Belopolsky 3e7a3cb903 Issue #28148: Stop using localtime() and gmtime() in the time module.
Introduced platform independent _PyTime_localtime API that is similar
to POSIX localtime_r, but available on all platforms.  Patch by Ed
Schouten.
2016-09-28 17:31:35 -04:00
Serhiy Storchaka 4781b59185 Issues #25909, #28211: Restored correct documentation of PyMapping_Items,
PyMapping_Keys and PyMapping_Values.  Based on patch by Xiang Zhang.
2016-09-26 20:53:27 +03:00
Serhiy Storchaka 1d480bea9c Issues #25909, #28211: Restored correct documentation of PyMapping_Items,
PyMapping_Keys and PyMapping_Values.  Based on patch by Xiang Zhang.
2016-09-26 20:52:41 +03:00
Benjamin Peterson 0c21214f3e replace usage of Py_VA_COPY with the (C99) standard va_copy 2016-09-20 20:39:33 -07:00
Benjamin Peterson e2e792d98f merge 3.5 (#28184) 2016-09-19 22:17:16 -07:00
Benjamin Peterson 918aa89483 remove trailing whitespace 2016-09-19 22:16:36 -07:00
Benjamin Peterson ac965ca16c stop using Py_LL and Py_ULL 2016-09-18 18:12:21 -07:00
Benjamin Peterson 41e35f37ed always define HAVE_LONG_LONG (#27961) 2016-09-18 18:02:58 -07:00
Benjamin Peterson 9ac11a752a properly free memory in pgen 2016-09-18 18:00:25 -07:00
Martin Panter d508d00919 Issue #28139: Merge indentation fixes from 3.5 into 3.6 2016-09-17 07:59:14 +00:00
Martin Panter 6d57fe1c23 Issue #28139: Fix messed up indentation
Also update the classmethod and staticmethod doc strings and comments to
match the RST documentation.
2016-09-17 03:26:16 +00:00
Victor Stinner 611b0fa94c Add _PyDict_CheckConsistency()
Issue #28127: Add a function to check that a dictionary remains consistent
after any change.

By default, tables are not checked, only basic attributes. Define DEBUG_PYDICT
(ex: gcc -D DEBUG_PYDICT) to also check dictionary "content".
2016-09-14 15:02:01 +02:00
Christian Heimes f051e43b22 Issue #28126: Replace Py_MEMCPY with memcpy(). Visual Studio can properly optimize memcpy(). 2016-09-13 20:22:02 +02:00
Ned Deily 4a94bbe517 Start 3.6.0b2 2016-09-12 15:49:58 -04:00
Ned Deily beb798cad6 Version bump for 3.6.0b1 2016-09-12 11:04:12 -04:00
Victor Stinner 137f39ac90 Issue #27810: Exclude METH_FASTCALL from the stable API 2016-09-12 15:55:21 +02:00
Victor Stinner 57f91ac95a Document kwnames in _PyObject_FastCallKeywords() and _PyStack_AsDict()
Issue #27213.
2016-09-12 13:37:07 +02:00
Victor Stinner b8d768b019 Revert change f860b7a775c5
Revert change "Issue #27213: Reintroduce checks in _PyStack_AsDict()", pushed
by mistake.
2016-09-12 13:30:02 +02:00
Victor Stinner b1e169bf4b ssue #27213: Reintroduce checks in _PyStack_AsDict() 2016-09-12 12:55:28 +02:00
Serhiy Storchaka b72810583e Issue #27213: Fixed different issues with reworked CALL_FUNCTION* opcodes.
* BUILD_TUPLE_UNPACK and BUILD_MAP_UNPACK_WITH_CALL no longer generated with
  single tuple or dict.
* Restored more informative error messages for incorrect var-positional and
  var-keyword arguments.
* Removed code duplications in _PyEval_EvalCodeWithName().
* Removed redundant runtime checks and parameters in _PyStack_AsDict().
* Added a workaround and enabled previously disabled test in test_traceback.
* Removed dead code from the dis module.
2016-09-12 00:52:40 +03:00
Serhiy Storchaka ab8740058a Issue #27129: Replaced wordcode related magic constants with macros. 2016-09-11 13:48:15 +03:00
Serhiy Storchaka 9fab79bcb5 Issue #26900: Excluded underscored names and other private API from limited API. 2016-09-11 11:03:14 +03:00
Benjamin Peterson 39e10616fb add the usual extern C silliness to pydtrace.h 2016-09-10 17:34:15 -07:00
Łukasz Langa fef7e94fa1 Don't run garbage collection on interpreter exit if it was explicitly disabled
by the user.
2016-09-09 21:47:46 -07:00
Victor Stinner f0ccbbbc57 Emit METH_FASTCALL code in Argument Clinic
Issue #27810:

* Modify vgetargskeywordsfast() to work on a C array of PyObject* rather than
  working on a tuple directly.
* Add _PyArg_ParseStack()
* Argument Clinic now emits code using the new METH_FASTCALL calling convention
2016-09-09 17:40:38 -07:00
Victor Stinner a9efb2f56e Add METH_FASTCALL calling convention
Issue #27810: Add a new calling convention for C functions:

    PyObject* func(PyObject *self, PyObject **args,
                   Py_ssize_t nargs, PyObject *kwnames);

Where args is a C array of positional arguments followed by values of keyword
arguments. nargs is the number of positional arguments, kwnames are keys of
keyword arguments. kwnames can be NULL.
2016-09-09 17:40:22 -07:00
Benjamin Peterson feb7edc153 dummy dtrace probes are a good place to use inline functions 2016-09-09 18:09:52 -07:00
Benjamin Peterson dec2df3df3 fix dummy macro 2016-09-09 17:46:24 -07:00
Łukasz Langa a785c87d6e DTrace support: function calls, GC activity, line execution
Tested on macOS 10.11 dtrace, Ubuntu 16.04 SystemTap, and libbcc.

Largely based by an initial patch by Jesús Cea Avión, with some
influence from Dave Malcolm's SystemTap patch and Nikhil Benesch's
unification patch.

Things deliberately left out for simplicity:
- ustack helpers, I have no way of testing them at this point since
they are Solaris-specific
- PyFrameObject * in function__entry/function__return, this is
SystemTap-specific
- SPARC support
- dynamic tracing
- sys module dtrace facility introspection

All of those might be added later.
2016-09-09 17:37:37 -07:00
Benjamin Peterson 4fd64b9a6a remove ceval timestamp support 2016-09-09 14:57:58 -07:00
Brett Cannon a721abac29 Issue #26331: Implement the parsing part of PEP 515.
Thanks to Georg Brandl for the patch.
2016-09-09 14:57:09 -07:00
Victor Stinner ae8b69c410 Issue #27810: Add _PyCFunction_FastCallKeywords()
Use _PyCFunction_FastCallKeywords() in ceval.c: it allows to remove a lot of
code from ceval.c which was only used to call C functions.
2016-09-09 14:07:44 -07:00
Victor Stinner d873572095 Add _PyObject_FastCallKeywords()
Issue #27830: Add _PyObject_FastCallKeywords(): avoid the creation of a
temporary dictionary for keyword arguments.

Other changes:

* Cleanup call_function() and fast_function() (ex: rename nk to nkwargs)
* Remove now useless do_call(), replaced with _PyObject_FastCallKeywords()
2016-09-09 12:36:44 -07:00
Victor Stinner f9b760f48a Rework CALL_FUNCTION* opcodes
Issue #27213: Rework CALL_FUNCTION* opcodes to produce shorter and more
efficient bytecode:

* CALL_FUNCTION now only accepts position arguments
* CALL_FUNCTION_KW accepts position arguments and keyword arguments, but keys
  of keyword arguments are packed into a constant tuple.
* CALL_FUNCTION_EX is the most generic, it expects a tuple and a dict for
  positional and keyword arguments.

CALL_FUNCTION_VAR and CALL_FUNCTION_VAR_KW opcodes have been removed.

2 tests of test_traceback are currently broken: skip test, the issue #28050 was
created to track the issue.

Patch by Demur Rumed, design by Serhiy Storchaka, reviewed by Serhiy Storchaka
and Victor Stinner.
2016-09-09 10:17:08 -07:00
Yury Selivanov 52c4e7cc84 Issue #28008: Implement PEP 530 -- asynchronous comprehensions. 2016-09-09 10:36:01 -07:00
Yury Selivanov eb6364557f Issue #28003: Implement PEP 525 -- Asynchronous Generators. 2016-09-08 22:01:51 -07:00
Yury Selivanov f8cb8a16a3 Issue #27985: Implement PEP 526 -- Syntax for Variable Annotations.
Patch by Ivan Levkivskyi.
2016-09-08 20:50:03 -07:00
Eric Snow 4f29e75289 Issue #24254: Drop cls.__definition_order__. 2016-09-08 15:11:11 -07:00
Martin Panter 0be894b2f6 Issue #27895: Spelling fixes (Contributed by Ville Skyttä). 2016-09-07 12:03:06 +00:00
Steve Dower 3929499914 Issue #1602: Windows console doesn't input or print Unicode (PEP 528)
Closes #17602: Adds a readline implementation for the Windows console
2016-08-30 21:22:36 -07:00
Victor Stinner 3b6a6b4215 Add a new private version to the builtin dict type
Issue #26058: Add a new private version to the builtin dict type, incremented
at each dictionary creation and at each dictionary change.

Implementation of the PEP 509.
2016-09-08 12:51:24 -07:00
Victor Stinner a4348cc1be Add documentation to the dict implementation
Issue #27350.
2016-09-08 12:01:25 -07:00
Benjamin Peterson a13e367778 simplify Py_UCSN definitions with stdint types 2016-09-08 11:38:28 -07:00
Steve Dower 940f33a50f Issue #23524: Finish removing _PyVerify_fd from sources 2016-09-08 11:21:54 -07:00
Steve Dower cc16be85c0 Issue #27781: Change file system encoding on Windows to UTF-8 (PEP 529) 2016-09-08 10:35:16 -07:00
Victor Stinner 98ee9d5b73 Add Py_MEMBER_SIZE macro
Issue #27350: use Py_MEMBER_SIZE() macro to get the size of
PyDictKeyEntry.dk_indices, rather than hardcoding 8.
2016-09-08 09:33:56 -07:00
Victor Stinner 742da040db Implement compact dict
Issue #27350: `dict` implementation is changed like PyPy. It is more compact
and preserves insertion order.

_PyDict_Dummy() function has been removed.

Disable test_gdb: python-gdb.py is not updated yet to the new structure of
compact dictionaries (issue #28023).

Patch written by INADA Naoki.
2016-09-07 17:40:12 -07:00
Benjamin Peterson 47ff0734b8 more PY_LONG_LONG to long long 2016-09-08 09:15:54 -07:00
Eric Snow 46f97b85a8 Issue #15767: Use ModuleNotFoundError. 2016-09-07 16:56:15 -07:00
Eric Snow c943265ba5 Issue #15767: Add ModuleNotFoundError. 2016-09-07 15:42:32 -07:00