type checking
Alex Martelli
aleax at aleax.it
Mon Oct 13 10:10:43 EDT 2003
Stephen Horne wrote:
> On Mon, 13 Oct 2003 11:52:31 GMT, Alex Martelli <aleax at aleax.it>
> wrote:
>
>>The "immediate destruction when last reference gone" is an implementation
>>specific detail of CPython -- handy, but there's quite a price paid for
>>it, so the _language_ makes no guarantees. So you have try/finally for
>>those cases where you NEED guarantees (not as handy, admittedly).
>
> Ah - I think I've just had one of those subtle but important paradigm
> shifts. Resource management (for resources other than memory) simply
> rests on slightly different language mechanisms in Python and Java
> than it does in C++.
Yes, this is a good way to put it, I think.
> Oddly enough, I think my Python code has reflected this for some time
> without me noticing the issue.
Interesting indeed! This kind of "you're smarter than you know" effect
IS observed time and again, admittedly...
Alex
More information about the Python-list
mailing list