[issue44845] Allow keyword arguments in code.__new__

Patrick Reader report at bugs.python.org
Thu Aug 5 15:55:55 EDT 2021


New submission from Patrick Reader <pxeger at 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 <report at bugs.python.org>
<https://bugs.python.org/issue44845>
_______________________________________


More information about the Python-bugs-list mailing list