[Python-Dev] Re: NEWLINE sentinel behavior in CPython's PEG grammar

2022-10-27 Thread Matthieu Dartiailh
If you look at pegen, that uses the stdlib tokenizer as input, you will see that the obejct us3d to implement memoization on top of a token stream simply swallow NL ( https://github.com/we-like-parsers/pegen/blob/main/src/pegen/tokenizer.py#L49). This is safe since NL has no syntactic meaning only

[Python-Dev] CACHE opcode in Python 3.11 bytecode

2022-07-25 Thread Matthieu Dartiailh
Hi all, I am in the slow process of adding support for Python 3.11 in the bytecode project (https://github.com/MatthieuDartiailh/bytecode). While attempting to update some tests I stumbled upon the need to include CACHE opcode to get things to work. For example, one can use bytecode to

[Python-Dev] Re: Python 3.11 bytecode and exception table

2022-07-05 Thread Matthieu Dartiailh
block in non-contiguous order (in https://github.com/python/cpython/pull/93622 I fixed one of those cases to reduce the size of the exception table, but it wasn't a correctness bug). Irit On Tue, Jul 5, 2022 at 9:27 AM Matthieu Dartiailh wrote: Hi all, I am the current maintainer

[Python-Dev] Python 3.11 bytecode and exception table

2022-07-05 Thread Matthieu Dartiailh
Hi all, I am the current maintainer of bytecode (https://github.com/MatthieuDartiailh/bytecode) which is a library to perform assembly and disassembly of Python bytecode. The library was created by V. Stinner. I started looking in Python 3.11 support in bytecode, I read

[Python-Dev] Re: code.replace() and Python 3.11 exception table

2022-04-01 Thread Matthieu Dartiailh
starting with 3.11 ? Best Matthieu Dartiailh On Fri, Apr 1, 2022, 18:34 Mark Shannon wrote: > Hi Gabriele, > > On 01/04/2022 4:50 pm, Gabriele wrote: > > Does this mean that this line in the bytecode library is likely to fail > with 3.11, with no way to fix it? > > > &

[Python-Dev] CALL_FUNCTION_EX arg and stack_effect

2017-02-20 Thread Matthieu Dartiailh
Hi, I have a question about the use of CALL_FUNCTION_EX in https://github.com/python/cpython/blob/master/Python/compile.c#L3624. Looking at the code it appears that the argument will be either 1 or 0 depending on whether or not the function is taking keywords arguments (which means that