Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

typing: `Application.step()`

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

メンテナーはふだん 2 日以内に返信

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
58/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
python

調査の方向性

issue に記載されている Application.step() と _step() のエントリーポイントから始め、両方のメソッドのいずれかが None を生成する可能性があるかどうかを判断するために、すべての return パスを調べます。その動作に合わせて return アノテーションとランタイム契約を整合させ、その後、結果のアンパックによって報告された型チェック警告が発生しなくなったことを確認します。

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

説明

area/core area/typing kind/improvement priority/low

Currently, Application.step() gives a bunch of squiggly red lines when trying to unpack the return value.

image

This is because .step() is annotated as follow, potentially returning None, which can't be unpacked

def step(self, inputs: Optional[Dict[str, Any]] = None) -> Optional[Tuple[Action, dict, State]]:
   # ...
   return self._step(...)
   
def _step(
   self, inputs: Optional[Dict[str, Any]], _run_hooks: bool = True
) -> Optional[Tuple[Action, dict, State]]:
   # ... 
   return next_action, result, new_state

(the return line of ._step() also has red squiggly lines)

Does ._step() actually ever return None ? If yes, would it make sense to have it return
(None, None, None) instead?

Having two potentially return values (the tuple or None) can be annoying to deal with if they have different "shapes". I'm guessing that directly unpacking the return value is common.

主要言語
Python
スター
2.6k
フォーク
203
平均マージ
3日 10時間
マージ済み PR(30日)
6

環境構築

はじめの一歩

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

apache/burr のほかの issue

apache/burr の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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