Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python/deep & shallow copy error #4860

Open
AnkurKumarShukla opened this issue Mar 13, 2024 · 2 comments
Open

Python/deep & shallow copy error #4860

AnkurKumarShukla opened this issue Mar 13, 2024 · 2 comments

Comments

@AnkurKumarShukla
Copy link

Is this a major issue that you cannot fix?

I can fix it.
Being a community driven documents of languages and tools,"YOUR" contributions
are also important.
If the issue you're reporting is trivial to report to maintainers why not contribute
to fix it. In that way, you will have contributed to an awesome open-source project.
The changes can be typo fix, fixing of data in examples or grammar fix. If you found it,
why not do it and take full credit for it?

Make sure the issue title is prepended with '[language/lang-code]' if the language is
already on the site.
If it's a request for a new language, use: '[Request] [language/lang-code]'

Issues are always welcome. If you are able and willing, we welcome any pull requests
as this is a community powered project.

Issue line : # Make a one layer deep copy using slices
li2 = li[:] # => li2 = [1, 2, 4, 3] but (li2 is li) will result in false.

@AnkurKumarShukla
Copy link
Author

Make a one layer deep copy using slices

li2 = li[:] # => li2 = [1, 2, 4, 3] but (li2 is li) will result in false.

in this line it say it create deep copy . but its found that it create shallow copy

@jklebes
Copy link
Contributor

jklebes commented Sep 25, 2024

Well spotted, that is not a deep copy.

I think it's simply an error of unclear writing. The original comment author meant "a one-layer-deep copy" , i.e a shallow copy, while @AnkurKumarShukla and many others read "a one-layer deep-copy", i.e. a type of deep copy.

I will fix and PR.

BTW I checked if the confusion has propagated to other languages.

French has it right,
the line doesn't exist in German, Spanish, Turkish
Italian quotes the ambiguous English
Vietnamese quotes the wrong English Interpretation.
pt-br probably translated the wrong interpretation
I don't know about arabic, czech, russian, japanese, Chinese

Help needed: Someone to correct

  • Italian
  • Vietnamese
  • Portuguese

Someone to check. Arabic, Czech, Russian, Japanese, Chinese

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants