gh-148542: docs: clarify call by value vs reference in Tutorial 4.8 by dagangtj · Pull Request #148563 · python/cpython

Conversation

@dagangtj

@dagangtj dagangtj commented

Apr 14, 2026

edited by github-actions bot

Loading

Summary

Clarifies the explanation of argument passing in Tutorial Section 4.8 to reduce confusion about call by value vs reference.

Changes

  • Updated the description of how arguments are passed
  • Clarified that mutations to mutable objects are visible outside, while reassignments inside the function are not
  • Added a short example demonstrating the difference between mutation and reassignment
  • Removed the now-redundant footnote

Fixes #148542


📚 Documentation preview 📚: https://cpython-previews--148563.org.readthedocs.build/

@StanFromIreland StanFromIreland changed the title docs: clarify call by value vs reference in Tutorial 4.8 gh-148542: docs: clarify call by value vs reference in Tutorial 4.8

Apr 14, 2026

Labels

1 participant

@dagangtj