New GitHub issue #101072 from MatthieuDartiailh:<br>
<hr>
<pre>
# Bug report
3.11 Started using `_PyFunction_FromConstructor` inside PyEval_EvalCodeEx. #92173 reported that this caused issues when closures were involved because `_PyFunction_FromConstructor` discarded the closure found in `PyFrameConstructor`. This was fixed in #92175.
It turns out the same holds true for default arguments and default kw arguments as can be seen at https://github.com/python/cpython/blob/main/Objects/funcobject.c#L90-L91 and is a regression compared to 3.10.
The fix appears fairly simple but I would love to have some guidance as to where to add a test for it.
# Your environment
- CPython versions tested on: 3.11.0
- Operating system and architecture: Windows x86-64
</pre>
<hr>
<a href="https://github.com/python/cpython/issues/101072">View on GitHub</a>
<p>Labels: type-bug</p>
<p>Assignee: </p>