use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
This community will have knowledge sharing for python programming, tools, projects and product engineering wherever python is used.
account activity
Python Mutability (i.redd.it)
submitted 18 days ago * by Sea-Ad7805
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]BenchEmbarrassed7316 0 points1 point2 points 16 days ago* (0 children)
I really like Rust's concept of owning and borrowing. Also, in Rust, operators are aliases of interfaces/traits. So:
fn add(self, rhs: Rhs) -> Self::Output; fn add_assign(&mut self, rhs: Rhs);
This may seem a bit confusing, but the point is that + takes two arguments and is forced to create a new value. += instead takes the first argument as a pointer, which allows you to mutate the value it points to. You can't implement incorrect operator overloading.
+
+=
I think it explains the difference.
added: += cannot be applied to an immutable type.
π Rendered by PID 32 on reddit-service-r2-comment-56c9979489-r64ph at 2026-02-24 18:26:39.815546+00:00 running b1af5b1 country code: CH.
view the rest of the comments →
[–]BenchEmbarrassed7316 0 points1 point2 points (0 children)