[issue46967] Type union for except
New submission from Henry Schreiner : In 3.10 via PEP 604, there was an attempt to use the new union of types where runtime types were previously expected to be a tuple. `isinstance(x, (A, B))` can be written `isinstance(x, A | B)`. Unfortunately, there still is a case were a tuple of types is required: `except (A, B) as err:` cannot be written `except A | B as err:`. I think this should be allowed; it is consistent with isinstance and pattern matching's use of |, and nicely avoids confusion with `except A, B:` which is disallowed for Python 2 reasons; `except A | B`: would be valid. -- components: Interpreter Core messages: 414807 nosy: Henry Schreiner priority: normal severity: normal status: open title: Type union for except type: enhancement versions: Python 3.11 ___ Python tracker <https://bugs.python.org/issue46967> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43532] Add keyword-only fields to dataclasses
Change by Henry Schreiner : -- nosy: +Henry Schreiner nosy_count: 9.0 -> 10.0 pull_requests: +29405 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31235 ___ Python tracker <https://bugs.python.org/issue43532> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue46166] Get "self" args or non-null co_varnames from frame object with C-API
Henry Schreiner added the comment: It would be great to get this looked at before things start getting too locked in for 3.11! -- ___ Python tracker <https://bugs.python.org/issue46166> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27318] Add support for symlinks to zipfile
Change by Henry Schreiner : -- nosy: +Henry Schreiner ___ Python tracker <https://bugs.python.org/issue27318> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue46166] Get "self" args or non-null co_varnames from frame object with C-API
Change by Henry Schreiner : -- nosy: +Henry Schreiner ___ Python tracker <https://bugs.python.org/issue46166> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43112] SOABI on Linux does not distinguish between GNU libc and musl libc
Henry Schreiner added the comment: We had a call and have a potential path forward. Quick summary: * Add a patch on top of the current patch to make CPython look for `-gnu` on top of `-musl` for Alpine 3.15 and 3.14. Reverting the patch would break every Alpine wheel previously locally compiled (like NumPy) and would require rebuilding all shipped packages that depend on Python. * Revert the patch for CPython 3.10 in Alpine 3.16, due mid next year. * Take the existing patch (PR 24502) targeting upstream CPython 3.11 and change search to include `abi3-gnu` on musl after looking for `abi3-musl`. The ability to install both binaries into a single folder would be a new "feature" of CPython 3.11. * Optionally this could be checked and normalized by auditwheel (like changing `-musl` to `-gnu` on 3.9) if desired. ABI3 wheels targeting <3.11 could be normalized to `-gnu`. How does that sound? -- nosy: +Henry Schreiner ___ Python tracker <https://bugs.python.org/issue43112> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8557] subprocess PATH semantics and portability
Change by Henry Schreiner : -- nosy: +Henry Schreiner ___ Python tracker <https://bugs.python.org/issue8557> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43453] docs: runtime_checkable example refers to changed behavior in 3.10
New submission from Henry Schreiner : The documentation here: https://docs.python.org/3/library/typing.html#typing.runtime_checkable refers to "For example, builtins.complex implements __float__(), therefore it passes an issubclass() check against SupportsFloat. However, the complex.__float__ method exists only to raise a TypeError with a more informative message.". However, that's not true in Python 3.10 anymore, those methods were thankfully removed. See https://docs.python.org/3.10/whatsnew/3.10.html#removed or https://bugs.python.org/issue41974 for the removal. This documentation should either say "before Python 3.10, ...", or pick some other example that still is valid. Happy to make the change if I know what direction this should go. -- assignee: docs@python components: Documentation messages: 388387 nosy: Henry Schreiner, docs@python priority: normal severity: normal status: open title: docs: runtime_checkable example refers to changed behavior in 3.10 type: behavior versions: Python 3.10 ___ Python tracker <https://bugs.python.org/issue43453> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue42015] Order of decrementing reference counts in meth_dealloc
Henry Schreiner added the comment: I tested before the patch, and I got 17 segfaults running a pybind11 module 20 times. After the patch, I ran about 50 times and had no segfaults! -- ___ Python tracker <https://bugs.python.org/issue42015> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue42015] Order of decrementing reference counts in meth_dealloc
Change by Henry Schreiner : -- nosy: +Henry Schreiner ___ Python tracker <https://bugs.python.org/issue42015> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41366] sign-conversion warning in 3.9 beta
New submission from Henry Schreiner : The macro Py_UNICODE_COPY was replaced by a function in CPython 3.9, and that function cannot compile with full warnings enabled + warnings as errors under Clang. The problematic line: Py_DEPRECATED(3.3) static inline void Py_UNICODE_COPY(Py_UNICODE *target, const Py_UNICODE *source, Py_ssize_t length) { memcpy(target, source, length * sizeof(Py_UNICODE)); } has an implicit conversion of Py_ssize_t into size_t, which creates: /Users/runner/hostedtoolcache/Python/3.9.0-beta.5/x64/include/python3.9/cpython/unicodeobject.h:55:: implicit conversion changes signedness: 'Py_ssize_t' (aka 'long') to 'unsigned long' [-Werror,-Wsign-conversion] error: implicit conversion changes signedness: 'Py_ssize_t' (aka 'long') to 'unsigned long' [-Werror,-Wsign-conversion] memcpy(target, source, length * sizeof(Py_UNICODE));memcpy(target, source, length * sizeof(Py_UNICODE)); An explicit cast to size_t (is there a Py_size_t?) should be made. -- components: C API messages: 374084 nosy: Henry Schreiner priority: normal severity: normal status: open title: sign-conversion warning in 3.9 beta type: compile error versions: Python 3.10, Python 3.9 ___ Python tracker <https://bugs.python.org/issue41366> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com