Tracking variable whereabouts in a plugin
まだ誰も着手していません。
評価
調査の方向性
まず、リンク先の loguru-mypy の質問と loguru の元の pull request を確認し、その後、ここに示されている連鎖した opt(...).info(...) 呼び出しを mypy がどのように処理するかを調べます。この issue ではファイル、テスト、または確定した実装方針が特定されていません。完了するには、これらの呼び出し全体で logger オブジェクトを追跡するための合意された方法と、明確に定義された検証ケースが必要です。
索引モデルが issue の本文から書いたものです。
説明
Please provide more information to help us understand the issue:
- Type: question
- Referecenes:
- Expected behavior: being able to track down variable i.e. from a process it was initialized.
Code below should illustrate an expected behavior. - Actual behavior: n/a
- mypy version:
>=0.770
from luguru import logger
LOG_A = logger.opt(lazy=False)
LOG_B = logger.opt(lazy=True)
LOG_A.info('Test {}', lambda x: x) # should work
LOG_B.info('Test {}', lambda x: x) # error
logger.opt(lazy=False).info('Test {c}', c=lambda x: x) # should work
logger.opt(lazy=True).info('Test {d}', d=lambda x: x) # error
In short: with loguru you can use Callable[[], Any] for lazy loggers to avoid costly computations. But those have to be non-argument callables. Above you can find non-lazy loggers that will work just fine by doing str(callable). In other words, to rephrase question from above, how can we:
track a variable/object on which behalf a method was called?
This is quite vital because type checking cannot be done solely on a method call level because we need something from another call. There is opt method being called but having call details from it without anything to tie them to will not help too much.
- 主要言語
- Python
- スター
- 20.6k
- フォーク
- 3.3k
- 平均マージ
- 1日 18時間
- マージ済み PR(30日)
- 54
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
python/mypy のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
bug topic-configuration topic-error-reporting
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
似ている issue
-
area/auth bug comp/agent P3 platform/discord type/security
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
NousResearch/hermes-agent#117848 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
bancolombia/sentinel#23 ·
-
test md オープンCI
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
langchain-ai/deepagents#6450 ·
-
bug client
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100