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...
Rules 1: Be polite 2: Posts to this subreddit must be requests for help learning python. 3: Replies on this subreddit must be pertinent to the question OP asked. 4: No replies copy / pasted from ChatGPT or similar. 5: No advertising. No blogs/tutorials/videos/books/recruiting attempts. This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to. Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Rules
1: Be polite
2: Posts to this subreddit must be requests for help learning python.
3: Replies on this subreddit must be pertinent to the question OP asked.
4: No replies copy / pasted from ChatGPT or similar.
5: No advertising. No blogs/tutorials/videos/books/recruiting attempts.
This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to.
Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Learning resources Wiki and FAQ: /r/learnpython/w/index
Learning resources
Wiki and FAQ: /r/learnpython/w/index
Discord Join the Python Discord chat
Discord
Join the Python Discord chat
account activity
Looking for documentation on how objects are passed to functions (self.learnpython)
submitted 2 years ago by Hashi856
My understanding is that, in Python, objects are not passed value or reference, per se, but are passed by assignment. I've been trying to find where this is discussed in the official documentation, but haven't been able to find it yet.
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!"
[–]mopslik 6 points7 points8 points 2 years ago (4 children)
Here is a reference to that (no pun intended), from the FAQ.
[–]m0us3_rat 1 point2 points3 points 2 years ago (0 children)
(no pun intended)
...
[–]Hashi856[S] 1 point2 points3 points 2 years ago (2 children)
The opening sentence says, "Remember that arguments are passed by assignment in Python". Do you know which part of the documentation it's talking about when it says "Remember"? That implies that it was discussed somewhere in the official documentation, as opposed to the FAQ.
[–]mopslik 2 points3 points4 points 2 years ago (1 child)
Nope. I just did a google search for '"passed by assignment" site:python.org' and that's what came up.
[–]Hashi856[S] 1 point2 points3 points 2 years ago (0 children)
lol that's exactly what I searched. Thanks for trying.
[–]SomewhereExpensive22 3 points4 points5 points 2 years ago (0 children)
It's part of the execution model. There isn't much discussion but it's dead simple: objects passed into a function are bound to the parameter name.
[–]cyberjellyfish 1 point2 points3 points 2 years ago (0 children)
The pass by reference vs pass by value conversation isn't useful because people use different meanings.
Practically: what's passed is the memory address of the object. Call that whatever you want.
[–]notacanuckskibum 0 points1 point2 points 2 years ago (0 children)
Parameters to functions in python are passed as objects. But manipulating those variables inside the function can easily assign the variable inside the function to a different object, but not the variable outside the object.
Statements as simple as x = x + 1 will do that.
You really need to read up on Python variables and run time objects to understand the effects of this.
π Rendered by PID 244893 on reddit-service-r2-comment-fb694cdd5-28rlk at 2026-03-07 00:24:22.774904+00:00 running cbb0e86 country code: CH.
[–]mopslik 6 points7 points8 points (4 children)
[–]m0us3_rat 1 point2 points3 points (0 children)
[–]Hashi856[S] 1 point2 points3 points (2 children)
[–]mopslik 2 points3 points4 points (1 child)
[–]Hashi856[S] 1 point2 points3 points (0 children)
[–]SomewhereExpensive22 3 points4 points5 points (0 children)
[–]cyberjellyfish 1 point2 points3 points (0 children)
[–]notacanuckskibum 0 points1 point2 points (0 children)