Message162661
> Is this documented in whatsnew?
I'm not sure what has been (none of my patches have done so).
> Also, I remember a discussion about making it public or not, but
> don’t recall a decision.
Amaury brought it up in msg162127. His point was that the type is public in Python, so why not the C API? That's about the extent of the discussion. :) Do you see any harm in making PyNamespace_New() public?
> I personally find it bad that we have structseqs for most things, dicts
> in PEP 418 get_clock_info return values, and now simplenamespace for
> sys.implementation.
The use cases are different for the different types. StructSequence/namedtuple provides fixed data structures for structured records. A dict is essentially the opposite: an un-fixed data structure for dynamic namespaces, making no firm promises as to what the future holds.
SimpleNamespace fills a similar role to dicts, but offers a higher appearance of stability by virtue of using attributes vs. keys. The problem is that moving from item-access to attribute-access is not a backward-compatible change. That's the big reason why PEP 421 specified the use of an attr-based object. |
|
Date |
User |
Action |
Args |
2012-06-12 03:28:29 | eric.snow | set | recipients:
+ eric.snow, rhettinger, amaury.forgeotdarc, vstinner, eric.araujo |
2012-06-12 03:28:29 | eric.snow | set | messageid: <1339471709.73.0.238320200937.issue15003@psf.upfronthosting.co.za> |
2012-06-12 03:28:29 | eric.snow | link | issue15003 messages |
2012-06-12 03:28:27 | eric.snow | create | |
|