[proxy] web.archive.org← back | site home | direct (HTTPS) ↗ | proxy home | ◑ dark◐ light

python/cpython

vstinner

Commits on Sep 16, 2020

  1. bpo-41746: Add type information to asdl_seq objects (GH-22223)

    * Add new capability to the PEG parser to type variable assignments. For instance:
    ```
           | a[asdl_stmt_seq*]=';'.small_stmt+ [';'] NEWLINE { a }
    ```
    
    * Add new sequence types from the asdl definition (automatically generated)
    * Make `asdl_seq` type a generic aliasing pointer type.
    * Create a new `asdl_generic_seq` for the generic case using `void*`.
    * The old `asdl_seq_GET`/`ast_seq_SET` macros now are typed.
    * New `asdl_seq_GET_UNTYPED`/`ast_seq_SET_UNTYPED` macros for dealing with generic sequences.
    * Changes all possible `asdl_seq` types to use specific versions everywhere.

Commits on Sep 15, 2020

  1. bpo-41631: _ast module uses again a global state (#21961)

    Partially revert commit ac46eb4:
    "bpo-38113: Update the Python-ast.c generator to PEP384 (gh-15957)".
    
    Using a module state per module instance is causing subtle practical
    problems.
    
    For example, the Mercurial project replaces the __import__() function
    to implement lazy import, whereas Python expected that "import _ast"
    always return a fully initialized _ast module.
    
    Add _PyAST_Fini() to clear the state at exit.
    
    The _ast module has no state (set _astmodule.m_size to 0). Remove
    astmodule_traverse(), astmodule_clear() and astmodule_free()
    functions.

Commits on Sep 13, 2020

  1. bpo-33239: Fix default value of 'buffering' parameter in docs of temp…

    …file.* functions (GH-21763)
    
    `None` doesn't work:
    
    ```python
    >>> import tempfile
    >>> tempfile.TemporaryFile(buffering=None)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/home/sergey/tmp/cpython-dev/Lib/tempfile.py", line 607, in TemporaryFile
        return _io.open(fd, mode, buffering=buffering,
    TypeError: 'NoneType' object cannot be interpreted as an integer
    ```
    
    Automerge-Triggered-By: @vsajip