realpython / realpython/python-guide

"Mutable and Immutable Types" example

オープン
#298 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

主要言語
Batchfile
スター
29.8k
フォーク
5.9k
PR マージ指標
30日以内にマージされた PR はありません

説明

The best example in the Mutable and Immutable Types section of the Structuring Your Project page is:

# create a concatenated string from 0 to 19 (e.g. "012..1819")
nums = [str(n) for n in range(20)]
print "".join(nums)

It is considered the best example for being both more efficient and succinct.

Would this be a better example to use?

''.join(map(str, range(20)))

It's more succinct and is faster:

$ python -m timeit "nums = [str(n) for n in range(20)]; ''.join(nums)"
100000 loops, best of 3: 6.84 usec per loop

$ python -m timeit "''.join(map(str, range(20)))"
100000 loops, best of 3: 4.93 usec per loop

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

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

はじめの一歩

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

調査の方向性

リンク先の「Structuring Your Project」ページの「Mutable and Immutable Types」セクションから始め、既存の例と提案された式を比較してください。ドキュメントが合意された例を使用し、パフォーマンスに関する主張を正確に提示していれば完了です。

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

評価

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

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

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