cpython/Misc/NEWS.d/next/Library/2023-08-21-10-34-43.gh-issue-108191.GZM3mv.rst
Serhiy Storchaka 93b7ed7c6b
gh-108191: Add support of positional argument in SimpleNamespace constructor (GH-108195)
SimpleNamespace({'a': 1, 'b': 2}) and SimpleNamespace([('a', 1), ('b', 2)])
are now the same as SimpleNamespace(a=1, b=2).
2024-04-25 00:39:54 +03:00

3 lines
169 B
ReStructuredText

The :class:`types.SimpleNamespace` now accepts an optional positional
argument which specifies initial values of attributes as a dict or an
iterable of key-value pairs.