On Mon, Feb 22, 2021 at 2:09 AM Brendan Barnwell <brenb...@brenbarn.net> wrote:
> Thinking about this more, I think the main obstacle to use of > SimpleNamespace isn't the name, it's its the location. No one is going > to look in the types module for something like this. Why not just put > SimpleNamespace in the > collections module? THIS I completely agree with! I absolutely do not think this needs a built-in. But I also find that I've nearly never used SimpleNamespace; and 95% of the reason I don't is because of where it lives. Very commonly, I think about what particular collection is most relevant for my data. And if it's not a set, list, or dict, I nearly always look in `collections`. Looking in `types` feels just weird, and it probably has slipped my mind sometimes even when it would be the best choice. OK, yes occasionally I look in `queue`, which is collection-like. And dataclasses, of course (which I thought should have gone in `collections`). Or if I want some extra useful behaviors, maybe I use dbm or sqlite3, which are kinda collections too (or NumPy, Pandas, xarray, etc). But looking in `types` for a collection feels very wrong. -- The dead increasingly dominate and strangle both the living and the not-yet born. Vampiric capital and undead corporate persons abuse the lives and control the thoughts of homo faber. Ideas, once born, become abortifacients against new conceptions.
_______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/F53JDSXNRNM6DZ6U6BRKIG2A6CU5LIQ6/ Code of Conduct: http://python.org/psf/codeofconduct/