Feb. 13, 2015
10:42 a.m.
On Fri, Feb 13, 2015 at 11:19:58AM +0100, Morten Z wrote:
Namespaces are widely used in Python, but it appear that creating a namespace has no short form, like [] for list or {} for dict, but requires the lengthy types.SimpleNamespace, with prior import of types.
from types import SimpleNamespace as NS ns = NS(answer=42) Python did without a SimpleNamespace type for 20+ years. I don't think it is important enough to deserve dedicated syntax, especially yet another overloading of parentheses. Not everything needs to be syntax. -- Steve