Comment

Comment by dr_zoidberg

This reminds me of the "copy list" expression in Python:

    In [1]: a = [1, 2, 3]
    In [2]: b = a
    In [3]: a is b
    Out[3]: True
    In [4]: b = a[:]
    In [5]: a is b
    Out[5]: False
Usually this kind of "optimization" is done to avoid copying large ammounts of data in memory, but as you said, unless it's widesepread knowledge or explicitly stated, it can lead to some confusing situations/bugs.
parent dr_zoidberg 11 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton