[issue45482] [C API] Add PySimpleNamespace_New() function

2021-10-15 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 354c35220d25a893e502014478f6739dad6897f3 by Victor Stinner in 
branch 'main':
bpo-45482: Rename namespaceobject.h to pycore_namespace.h (GH-28975)
https://github.com/python/cpython/commit/354c35220d25a893e502014478f6739dad6897f3


--

___
Python tracker 

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



[issue45482] [C API] Add PySimpleNamespace_New() function

2021-10-15 Thread STINNER Victor


STINNER Victor  added the comment:

> The other choice is to move the function to the internal C API.

I created GH-28975 for that.

--

___
Python tracker 

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



[issue45482] [C API] Add PySimpleNamespace_New() function

2021-10-15 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +27263
pull_request: https://github.com/python/cpython/pull/28975

___
Python tracker 

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



[issue45482] [C API] Add PySimpleNamespace_New() function

2021-10-15 Thread STINNER Victor


STINNER Victor  added the comment:

I created this issue while cleaning the C API. I'm not fully convinced that 
PySimpleNamespace_New() must be made public.

The other choice is to move the function to the internal C API.

--

___
Python tracker 

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



[issue45482] [C API] Add PySimpleNamespace_New() function

2021-10-15 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue45482] [C API] Add PySimpleNamespace_New() function

2021-10-15 Thread STINNER Victor


New submission from STINNER Victor :

Python has a types.SimpleNamespace type which is convenient to cheap a "simple 
namespace". I propose to make its C API public (but exclude it from the limited 
C API): add PySimpleNamespace_New() function.

It's currently used in:

* Modules/timemodule.c: time.get_clock_info(name)
* Python/sysmodule.c: sys.implementation

It's also used in:

* Python/import.c: _PyImport_BootstrapImp()
* Modules/_testmultiphase.c: createfunc_nonmodule() used as the Py_mod_create 
slot

--
components: C API
messages: 403984
nosy: vstinner
priority: normal
severity: normal
status: open
title: [C API] Add PySimpleNamespace_New() function
versions: Python 3.11

___
Python tracker 

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