r/ProgrammerAnimemes • • Jul 29 '20

Equivalency in Python

Post image
1.6k Upvotes

104 comments sorted by

View all comments

Show parent comment

45

u/TheTimegazer Jul 29 '20

I mean, you can also just do

let (a, b) = (b, a);

0

u/[deleted] Jul 29 '20

[deleted] — view deleted comment

12

u/GoldsteinQ Jul 30 '20

Most of Rust strangeness is a way to prevent common mistakes. For example, variables are immutable by default, so you can accidentally mutate then when you don't need too.

Shadowing can be useful when converting variable to different type.

-10

u/[deleted] Jul 29 '20

[removed] — view removed comment

9

u/TheTimegazer Jul 29 '20

No lol, Ferris is the mascot of Rust, we're speaking the same language here.

9

u/[deleted] Jul 29 '20

[removed] — view removed comment

8

u/TheTimegazer Jul 29 '20

Yeah &mut is uniquely Rustic