Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8045615
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:36:11+00:00 2026-06-05T05:36:11+00:00

Many people say that in Python arguments to functions are passed using a call-by-value

  • 0

Many people say that in Python arguments to functions are passed using a call-by-value model. As I understand it, it is not actually a call-by-value language, but a call-by-object or call-by-sharing model.

What are the differences between a call-by-value model and a call-by-object model? What is an example in Python that shows how these models are different?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T05:36:14+00:00Added an answer on June 5, 2026 at 5:36 am

    Saying that it is not pass-by-value is not correct. Semantically, it is pass-by-value, and one can demonstrate the semantic equivalence between it and other pass-by-value languages. However, it belongs to a particular subcategory of pass-by-value languages where all the values are references (pointers) to objects (you cannot have an object as a value directly), and many people confuse a pointer to an object with the object itself. Such languages include Java (with respect to objects), Python, Ruby, JavaScript, Scheme, Smalltalk, just to name a few.

    To add to the confusion is that the communities of the different languages use different terminology. For example, the Java community consistently describes Java as pass-by-value, even though objects in Java have the exact same semantics as objects in Python and Ruby. However, you hear “pass-by-value” much less in these latter languages’ communities.

    Pass-by-value vs. pass-by-reference is essentially a semantic distinction, not one of what it is used for. But many (beginner) programmers don’t care so much about semantics, and care more about what it can be used to do. For example, some people think that whenever you have “I have some data that I give to a function and it can change it without returning it, and I can see the changes”, that means pass-by-reference, without actually thinking (or caring) about whether the thing that was changed was the thing you passed, or something that was indirectly pointed to by the thing you passed.

    “Pass by object” or “pass by sharing” or whatever is a term that coined to describe the combination of pass-by-value semantics along with having all values be references (pointers). In this way, they can more easily express the actual effects of such a combination, and distinguish it from the effects of pass-by-value in C, for example. But semantically it still is pass-by-value. Saying that variables are “names” or “handles” that are “bound” to objects and that when you assign or pass it, you share the object, is exactly equivalent to saying that variables (and in fact, all values in the language) are pointers to objects, and when you assign or pass them, these pointers are copied by value.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Many people have argued about function size. They say that functions in general should
Many people say that you just have to add the :username attribute in the
Lets say that its been two years (and many people left the company) and
Many people say that you should avoid new Object, new Array()and instead use {}.
I've heard many people say that if the number of expected elements in the
Many people say to me that set VARCHAR(100) doesnt make sense. It the same
Many people say that I should create a friendships table( userid , friendid ).
Recently thanks to rails' popularity, many people start using activerecord as model. however, before
Many people are saying that Apple has restricted it for better performance. If so
Like many people, I have several SVN repositories that contains several projects. I've decided

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.