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

Wrong return type on create_timer()

オープン 初心者向け
#587 コメント 2 件 リアクション 1 件 担当者 0 名 GitHub で見る

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
python
領域
api

調査の方向性

azure/durable_functions/models/DurableOrchestrationContext.py の 601 行目付近から始めて、create_timer() の戻り値アノテーションを調べてください。Pylance で例を再現し、cancel() の呼び出しで型チェックエラーが発生しなくなったこと、またアノテーションが返されるタイマータスクを正確に表していることを確認してください。

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

説明

bug Debuggability fixed-in-v2 P2

🐛 Describe the bug
Type hint for return value of create_timer() is TaskBase, but that does not contain the cancel() function. Returning TimerTask seems more appropiate.

Edit: See comment below on why TimerTask might not be a viable type anyway

Current source:

https://github.com/Azure/azure-functions-durable-python/blob/4ab004b6bc994b0395ee965186f8402b86b7a887/azure/durable_functions/models/DurableOrchestrationContext.py#L601

Example code:

    expiration = context.current_utc_datetime + timedelta(seconds=20)
    timeout_task = context.create_timer(expiration)
    timeout_task.cancel()  # <-- Pylance shows error: "Cannot access attribute "cancel" for class "TaskBase""

🤔 Expected behavior
You should be able to call cancel()without linter/type checker errors.

☕ Steps to reproduce
See above

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

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

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

Azure/azure-functions-durable-python のほかの issue

Azure/azure-functions-durable-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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