"Don't rebind built-in names*" - it confuses readers

Nobody nobody at nowhere.com
Thu Jun 13 06:09:29 EDT 2013


On Thu, 13 Jun 2013 01:23:27 +0000, Steven D'Aprano wrote:

> Python does have a globally-global namespace. It is called "builtins", and
> you're not supposed to touch it. Of course, being Python, you can if you
> want, but if you do, you are responsible for whatever toes you shoot off.
> 
> Modifying builtins will effect *all modules*. That's normally too much,
> although it can very, very, very occasionally be useful.

For a specific example, gettext.install() adds the _() function to the
builtins namespace.




More information about the Python-list mailing list