Deep vs. shallow copy?

Skip Montanaro skip at pobox.com
Wed Mar 12 15:48:38 CET 2014


On Wed, Mar 12, 2014 at 9:25 AM, Alex van der Spek <zdoor at xs4all.nl> wrote:
> with open(os.path.join('path', 'foo.txt', 'rb') as txt:
>      reader = csv.reader(txt)
>      data = [row.append(year) for row in reader]

Forget deep v. shallow copies. What is the value of the variable year?
And why would you expect list.append to return anything?

Skip



More information about the Python-list mailing list