`dis.dis` on empty classes does nothing
まだ誰も着手していません。
評価
調査の方向性
まず、提供された空のクラスの例を使い、dis.dis エントリーポイントを通じて報告された動作を再現します。dis.dis が dict メンバーを持たないクラスをどのように処理するかを追跡し、そのケースに対してユーザーに表示されるメッセージまたは例外を追加してから、空のクラスの例で今度は出力が何も生成されなくならないことを確認します。
索引モデルが issue の本文から書いたものです。
説明
Bug report
Expected behavior
dis.dis on an empty class should output a message along the lines of "Nothing to disassemble", or possibly raise an exception in that regard
Actual behavior
dis.dis produces no output when passed a class with no __dict__ members.
Repro case
Test code pasteable in interactive session:
if 1:
import sys
from dis import dis
class Empty: pass
print('Python', sys.version)
dis(Empty)
Output:
My local machine:
Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
Tutorialspoint:
Python 3.8.6 (default, Jan 29 2021, 17:38:16)
[GCC 8.4.1 20200928 (Red Hat 8.4.1-1)]
JDoodle:
Python 3.9.9 (main, Nov 20 2021, 21:30:06)
[GCC 11.1.0]
Pyodide:
Python 3.10.2 (main, Aug 9 2022, 13:42:49) [Clang 15.0.0 (https://github.com/llvm/llvm-project 7effcbda49ba32991b8955821b8f
Your environment
- CPython versions tested on: See output above
- Operating system and architecture: See output above
- 主要言語
- Python
- スター
- 77.2k
- フォーク
- 36k
- 平均マージ
- 1日 9時間
- マージ済み PR(30日)
- 558
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
python/cpython のほかの issue
-
docs pending
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
stdlib type-feature
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
stdlib type-feature
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
build type-bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
stdlib topic-email type-feature
難易度 2/5 1〜3時間 初心者へのやさしさ 70/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