nesting context managers

Rami Chowdhury rami.chowdhury at gmail.com
Tue Dec 20 12:46:09 EST 2011


On Tue, Dec 20, 2011 at 16:56, Ulrich Eckhardt
<ulrich.eckhardt at dominolaser.com> wrote:
> To be extra safe or in more complicated scenarios, I could wrap this in a
> try-except and explicitly close those that were already created, but
> normally I'd expect the garbage collector to do that for me ... or am I then
> implicitly assuming a specific implementation?

I'm no expert but I believe the basic garbage collection behavior is
part of the language, and it's only details of breaking cycles that
are specific to CPython -- can anyone correct me if I'm wrong?


-- 
Rami Chowdhury
"Never assume malice when stupidity will suffice." -- Hanlon's Razor
+44-7581-430-517 / +1-408-597-7068 / +88-0189-245544



More information about the Python-list mailing list