New submission from Patrick Reader <pxe...@protonmail.com>:

Per bpo-41263, code.__new__ now uses Argument Clinic. However, it still has a / 
marker which prevents the use of keyword arguments 
(https://github.com/python/cpython/pull/21426/files#diff-6f869eb8beb7cbe4bc6817584b99ad567f88962fa67f7beca25d009dc401234dR465).

It seems entirely unnecessary to have this, so could it be removed to allow 
easier construction of code objects from user code, or is it there for some 
specific reason?

I can do a PR - it's a 1 line change (+ clinic output changes) (+ tests?).

I don't imagine backwards-compatibility is a concern here given it's 
implementation-specific and basically private.

Note that prior to that fix, keyword arguments were allowed in the constructor 
but completely ignored.

----------
components: Interpreter Core
messages: 399034
nosy: pxeger
priority: normal
severity: normal
status: open
title: Allow keyword arguments in code.__new__
type: enhancement
versions: Python 3.11

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue44845>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to