Matti Picus pushed to branch branch/py3.9 at PyPy / pypy
Commits: bb445849 by Carl Friedrich Bolz-Tereick at 2023-07-11T14:51:00+02:00 #3961: don't uselessly compile a regex for *every* parsed email message. the pattern is anyway always the same, apart from a variable prefix. Instead, first check the prefix with str.startswith, and only if that returns True, match the rest of the regular expression. --HG-- branch : py3.9 - - - - - 40e7b78d by Carl Friedrich Bolz-Tereick at 2023-07-12T09:58:38+02:00 #3961: precompile res in csv module --HG-- branch : py3.9 - - - - - f7461ab8 by Matti Picus at 2023-07-12T13:26:55+03:00 fix test when run untranslated on top of pypy2.7 --HG-- branch : py3.9 - - - - - eaaa4dad by Rodrigo Tobar at 2023-06-30T15:00:02+08:00 Don't clear StopIteration exceptions on tp_iternext Even though tp_iternext *can* return NULL without an exception being set, it doesn't mean that it *has* to do it every time. In particular, coroutines convey their return values via a StopIteration they raise during its last call to next(), which is the only way C extensions can get access to them. This commit removes the exception handling in the tp_iternext slot implementation, letting it raise any exception it throws, including StopIteration exceptions. A new test verifies that this is working as expected by having a C extension exhaust a python-written coroutine, and verifying it gets access to the coroutine's return value. This addresses issue #3956. --HG-- branch : py3.9 - - - - - d9f4c269 by Matti Picus at 2023-06-30T16:53:28+03:00 use a different tp_internext wrapper for coroutines --HG-- branch : py3.9 - - - - - 903225e6 by Rodrigo Tobar at 2023-07-05T21:11:04+08:00 Let tp_iternext raise StopIteration more selectively First, we can deal with the situation of handling an exception or not from the same wrapped function, using a variable to control whether StopIterations should be raised or swallowed. Then, the value of such variable is calculated before the wrapped function is created, and is calculated from a hardcoded list of types that are known to raise StopIteration in their tp_iternext implementations. --HG-- branch : py3.9 - - - - - d0b409d3 by Rodrigo Tobar at 2023-07-05T21:11:17+08:00 Add test for tp_iternext with a generator --HG-- branch : py3.9 - - - - - d3c31e81 by Matti Picus at 2023-07-12T13:38:20+03:00 refactor logic --HG-- branch : py3.9 - - - - - 6 changed files: - lib-python/3/csv.py - lib-python/3/email/feedparser.py - pypy/module/cpyext/slotdefs.py - pypy/module/cpyext/test/test_async_iter.py - pypy/module/cpyext/test/test_typeobject.py - pypy/module/cpyext/test/test_unicodeobject.py View it on Heptapod: https://foss.heptapod.net/pypy/pypy/-/compare/4b4651169ad49d916c67b94015f2dfb8f6edc07b...d3c31e8109c72222707877fb6aab5a68f7e0f474 -- View it on Heptapod: https://foss.heptapod.net/pypy/pypy/-/compare/4b4651169ad49d916c67b94015f2dfb8f6edc07b...d3c31e8109c72222707877fb6aab5a68f7e0f474 You're receiving this email because of your account on foss.heptapod.net.
_______________________________________________ pypy-commit mailing list -- pypy-commit@python.org To unsubscribe send an email to pypy-commit-le...@python.org https://mail.python.org/mailman3/lists/pypy-commit.python.org/ Member address: arch...@mail-archive.com