Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Do you mean to say that mutating globals is not commonly used?

Because literally every import, class definition, or function definition that you make at top-level is a global.

Now some people do in fact do all those things inside a function, too, and then call that function as the only thing that actually happens globally. And I've done such hacks myself to squeeze the last few % of perf out of CPython on the very rare occasions where you need to do that but dropping into C is not an option. But that's certainly not idiomatic Python.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: