[New-bugs-announce] [issue43820] Remove namespace copy from dataclasses.make_dataclass()

Eric V. Smith report at bugs.python.org
Mon Apr 12 17:12:10 EDT 2021


New submission from Eric V. Smith <eric at trueblade.com>:

In make_dataclasses(), the "namespace" argument is copied because it is mutated. This isn't really necessary: the callback passed to types.new_class() could just update its "ns" parameter with "namespace" and with the new attributes (__anotations__ and default field values).

This would eliminate the need to copy "namespace".

----------
assignee: eric.smith
components: Library (Lib)
messages: 390907
nosy: eric.smith
priority: normal
severity: normal
status: open
title: Remove namespace copy from dataclasses.make_dataclass()
type: behavior
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43820>
_______________________________________


More information about the New-bugs-announce mailing list