Skip to content

Conversation

@NewUserHa
Copy link
Contributor

@NewUserHa NewUserHa commented Mar 9, 2025

Update documention of stdlib copy to clear that list can also be shallow copied via .copy()

a = [1,2]
b = a.copy()
b

this can work in recent versions of python


📚 Documentation preview 📚: https://cpython-previews--131027.org.readthedocs.build/


Shallow copies of dictionaries can be made using :meth:`dict.copy`, and
of lists by assigning a slice of the entire list, for example,
Shallow copies of dictionaries and lists can be made using :meth:`dict.copy`. And
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This now links to dict.copy for both a dicts and lists?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants