[Python-ideas] Anonymous namedtuples
contrebasse at gmail.com
Tue Apr 19 16:47:13 EDT 2016
> SimpleNamespace is neither a sequence nor a mapping.
I don't know the exact definition of a mapping, but to me SimpleNamespace is
like a dict with restricted keys (valid attributes only) and a nicer syntax.
`my_dict["key"]` is roughly equivalent to `my_namespace.key`.
SimpleNamespace lacks lots of methods comapred to dict. Maybe an
hypothetical ComplexNamespace would be in collections module ?
More information about the Python-ideas