python / python/cpython

Tutorial 4.8 call by value vs reference is confusing

オープン
#148,542 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

docs
主要言語
Python
スター
77.2k
フォーク
35.9k
PR マージ指標
PR 指標を取得中

説明

Documentation

The part about how arguments are passed in Section 4.8 (by value vs by reference) is written in a confusing way and there is even a footnote admitting to it

IMO an improvement would be along the lines:
Arguments are always passed using call by value. For objects that are passed this value consists of a reference to that object. Which means that mutations to the object are visible outside, reassignments of another reference to the variable inside the function are not. insert example

Linked PRs
  • gh-148563

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

docs.python.org/3/tutorial/controlflow.html#defining-functions にある Python チュートリアルのセクション 4.8 を脚注も含めて読み、リンクされた PR gh-148563 を確認してください。完了条件は、値渡しと参照渡しの説明がより明確になり、変更と再代入の違いを示す例が含まれていることです。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
documentation
issue の種類
ドキュメント
難易度
2/5
見積もり時間
1〜3時間
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
30/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。