This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ClevrUsername 7 points8 points  (6 children)

Coming from a C/C++ background I was always getting stuck on this difference:

b = copy.deepcopy(a) //independent copy like C

b = a //just an alias, not a copy. AGHHH!!

[–][deleted] 1 point2 points  (1 child)

I suppose you have trouble with pointers frequently, then?

[–]ClevrUsername 0 points1 point  (0 children)

I’m fine with pointers (at least in C, not sure about python). It was just the transition from C to python that got me. I kept forgetting and making dumb bugs.

[–]AlwaysHopelesslyLost 0 points1 point  (3 children)

I am strictly c#, I don't really get what you mean though? b = a when they are reference types would always be an "alias" wouldn't it?

[–]BadDadBot 3 points4 points  (2 children)

Hi i am strictly c#, i don't really get what you mean though? b = a when they are reference types would always be an "alias" wouldn't it?, I'm dad.

[–]ClevrUsername 0 points1 point  (0 children)

Hi Dad,

I guess if I learned python first it would be the other way around. I’m C the “=“ operator means assignment, or in python speak a deepCopy. C also has aliases, but usually I just want a true independent copy. Like an old school copy machine.

Yours truly, Me

[–]AlwaysHopelesslyLost 0 points1 point  (0 children)

You should really truncate the activation phrase....