How coding in Python is bad for you

Chris Angelico rosuav at gmail.com
Mon Jan 23 21:41:39 EST 2017


On Tue, Jan 24, 2017 at 12:55 PM, Steve D'Aprano
<steve+python at pearwood.info> wrote:
> Reading his post, I get the impression he's the sort of programmer who
> believes in never, ever, ever, ever re-using a variable, so he might do
> something like:
>
> raw_data = collect_raw_data()  # generates 10GB of data
> data_after_step_one = massage(raw_data)
> data_after_step_two = process(data_after_step_one)
> ...
> sorted_data = sorted(data_after_step_ten)
>
> and then wonders why he's running out of memory. "That's a memory leak!"

How is that any different in any other language? I don't understand
how even this is a criticism of Python. If you were working in Java,
say, you'd have basically the same result - keep all the stuff, keep
all the memory usage.

ChrisA



More information about the Python-list mailing list