On Mon, Jan 25, 2021 at 06:17:09PM +0100, Victor Stinner wrote: > Hi Bernat, > > "stdlib_module_names" was my first idea but it looks too long, so I > chose "module_names". But someone on Twitter and now you asked me why > not "stdlib_module_names", so I wrote a PR to rename module_names to > sys.stdlib_module_names: > https://github.com/python/cpython/pull/24332 > > At least "stdlib_module_names" better summarizes its definition: "A > frozenset of strings containing the names of standard library > modules".
Your first instinct that it is too long is correct. Just call it "stdlib" or "stdlib_names". The fact that it is a frozen set of module names will be obvious from just looking at it, and there is no need for the name to explain everything about it. We have: * `dir()`, not `sorted_dir_names()`; * `sys.prefix`, not `sys.site_specific_directory_path_prefix`; * `sys.audit`, not `sys.raise_audit_hook_event`; * `sys.exit()`, not `sys.exit_python()`; * `sys.float_info`, not `sys.float_prec_and_low_level_info`; etc. Python has very good documentation and excellent introspection capabilities. Names should act as a short reminder of the meaning, there is no need to encode a full description into a long amd verbose name. -- Steve _______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/7BEFXZLBH7L63WIZJZMZPQWHDDYTB3LR/ Code of Conduct: http://python.org/psf/codeofconduct/