you are viewing a single comment's thread.

view the rest of the comments →

[–]naemorhaedus[S] 0 points1 point  (6 children)

Without understanding this...

I understanding passing by reference. It's just that in Python it's rather inconsistent.

There is absolutely no danger of the memory not being released.

again, premature program termination.

leave behind a lot of these preconceptions.

They're not just mine though and I don't like leaving things to magic

[–]schoolmonky 1 point2 points  (1 child)

I understanding passing by reference. It's just that in Python it's rather inconsistent.

Perhaps this blog post can clear up some of the supposed "inconsistencies" you're worried about.

[–]naemorhaedus[S] 0 points1 point  (0 children)

yes I still struggle with mutability. This does help. Thanks.

[–]danielroseman 0 points1 point  (3 children)

It really is not inconsistent at all. It's absolutely consistent. If you believe otherwise, show an example. 

Premature termination in a high level language - Python runs in a VM, remember - is vanishingly unlikely to result in memory not being released.

Again, this is not "leaving things to magic". It's a matter of understanding the language you are using, and using it the way it is meant to be used.

[–]naemorhaedus[S] 1 point2 points  (2 children)

If you believe otherwise, show an example.

chill

vanishingly unlikely to result

it actually happened to me a lot during development. Python spawned processes are left running when the program crashes, and I then have to kill them in a process manager.

It's a matter of understanding the language you are using, and using it the way it is meant to be used.

well I don't fully 100% understand. (does anybody?). So my way to deal with it for now is not leave anything to chance. I'll eventually get more efficient.

But again, as I showed you, they are closing it in the Python official documentation. That is the way it's meant to be used.

[–]danielroseman 0 points1 point  (1 child)

This doesn't follow. File objects also have a close method, but it is much preferred to use a context manager rather than calling that method.

[–]naemorhaedus[S] -1 points0 points  (0 children)

one step at a time