gh-148542: docs: clarify call by value vs reference in Tutorial 4.8 by dagangtj · Pull Request #148563 · python/cpython
Conversation
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
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters