On Wed, Feb 17, 2021 at 9:11 PM Sven R. Kunze <[email protected]> wrote: > Still think that "object()" should be writable since this seems like an > arbitrary restriction (+SimpleNamespace is no builtin and at least I > would use object() for fast PoCs or dirty hackery). But I guess there's > been discussion around this already. >
It can't, because subclasses of object would then ALSO be writable, and that would break a lot of things. Also, a lot of use-cases for object() just need sentinels, with no attributes, so this would cost them a lot of efficiency. Using SimpleNamespace is the best way to do this, and maybe there's a good argument for making it a builtin (or at least giving it a shorter name), but changing object would be problematic. ChrisA _______________________________________________ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/WORTQLFJZDBQYB4YTUHMNXJL6RVUPZKA/ Code of Conduct: http://python.org/psf/codeofconduct/
