99% Of Python Developers Made THIS Crucial Mistake

preview_player
Показать описание
99% of Python developers made this crucial mistake. #python #code #shorts
Рекомендации по теме
Комментарии
Автор

A word of caution: deepcopy is EXTREMELY slow, so only use it if there is no other option

marcelk
Автор

in rust, we have the Copy and Clone traits.

ubuntubad
Автор

Hey, I knew that Python behaves this way already... Wow...😁

chris
Автор

I just do b=list (a) and that works, I don't know about nested lists tho

carsonellaruddii
Автор

cool to be part of that 1 % knowing it :P

kireiliev
Автор

is using a for loop to copy each nested list from list a and append them to list b (or by using list comprehension) slower than deepcopy?

sediew
Автор

thanks man, i usually working with multi d array/list. Nice to know this

hndr
Автор

Oh what there‘s a built-in deepcopy function in Python? That‘s so cool! Would love to have that in other languages like JS.

floskater
Автор

Or u could just assign a to b with equal to= sign

priya
Автор

Can you make a function in python which do permutation of strings

play_itover
Автор

Why shallow copy exist so if it's only superficial ?
ie why a.copy is not directly a deepcopy ?

Fine_Mouche
Автор

every language has this shallow copy/deep copy issue, but fr? python just has a function for this? that's so unfair

kenzostaelens
Автор

I would just do

b = a[:]

Im fairly sure this works. Please correct me if I’m wrong.

Destros
Автор

Would slicing work here?
Ex.
b = a[::]

ZaidAfaneh
Автор

who the f created such kind of garbage confusion

anildangol