Comment

Comment by sibsibsib

using list() in this manner feels a bit weird to me.

If you want to be truly explicit, why not use the built in copy module?

eg:

    from copy import copy
    b = copy(a)   #or deepcopy(), depending on your needs

*edit: I should note that the docs for copy suggest using the slice operator.
parent sibsibsib 15 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton