On Thu, Jan 22, 2009 at 5:22 PM, Giovanni Bajo <ra...@develer.com> wrote: > On Mon, 19 Jan 2009 01:38:18 +0000, Gregory P. Smith wrote: > >> I regularly point out in code reviews that the very convenient and >> common idiom of open(name, 'w').write(data) doesn't guarantee when the >> file will be closed; its up to the GC implementation details. > > Which, to me, sounds like "please, don't assume that bytes are 8-bits > wide; this depends on implementation details of your CPU".
I think it's a lot more like "please, don't assume that there's a Global Interpreter Lock" -- something that the implementation shouldn't change without good reason and sufficient warning, but which isn't actually part of the language specification. And of course, such advice always carries more weight for code that's intended to be reusable than it does for code that has little chance of escaping the application it's in. -- Curt Hagenlocher c...@hagenlocher.org _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com