On 2021-02-17 11:21, Chris Angelico wrote:
Okay. Let's start bikeshedding. If SimpleNamespace were to become a
builtin, what should its name be? It needs to be short (obviously),
but not TOO short, and it needs to be at least somewhat descriptive,
and it needs to not cause confusion with "object". Ideally, it should
get a name that's unlikely to conflict with names already in frequent
use.

* namespace
* ns
* Thing
* dump
* plunkit

Does using SimpleNamespace have any other meaningful ramifications besides being able to add attributes? When I see people suggest SimpleNamespace, it's usually just to use it as a dict which is accessed with attribute syntax instead of item syntax. Given that, I think a name like `attrdict` would be appropriate. (There is already a PyPI package called attrdict that uses this name for this purpose: https://pypi.org/project/attrdict/ , And I feel like I've seen other examples of similar names where someone wrote their own mini-implementation of such a thing.)

--
Brendan Barnwell
"Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail."
   --author unknown
_______________________________________________
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/7EURJ5E74GL7FEGYKC3DYR77PWMZ7KEZ/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to