[issue43820] Remove namespace copy from dataclasses.make_dataclass()

2021-04-14 Thread Eric V. Smith


Change by Eric V. Smith :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43820] Remove namespace copy from dataclasses.make_dataclass()

2021-04-12 Thread Eric V. Smith


Change by Eric V. Smith :


--
keywords: +patch
pull_requests: +24105
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/25372

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43820] Remove namespace copy from dataclasses.make_dataclass()

2021-04-12 Thread Eric V. Smith


New submission from Eric V. Smith :

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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com