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

If the default value for Unicode is traitlets.Undefined, then why is it type string when tested? How can you enforce CLI definition of an attribute if it self-massages to ""?

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
30/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
python
領域
cli

調査の方向性

まず、Unicode、Application、aliases、config=True、Application.launch_instance()を使った例を再現します。次に、Unicode のデフォルト処理と CLI の設定パスを調べ、ドキュメントに記載された Undefined の動作と、観測された空文字列を比較します。動作が説明または修正され、CLI で定義された属性を意図どおり適用することがテストでカバーされれば完了です。

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

説明

The code below shows that even though x is never given a value, it is an empty string.

Why do the docs for Unicode state default_value=traitlets.Undefined yet the type is string when tested?

from traitlets.config import Application
from traitlets import List, Dict, Integer, Unicode

class App(Application):

    aliases = {"x": "App.x", "y": "App.y"}
    x = Unicode().tag(config=True)
    y = Unicode().tag(config=True)

    def start(self):
        print(f"typex = {type(self.x)} val={self.x}")
        print(f"y={self.y}")


if __name__ == "__main__":
    App.launch_instance()

Output

typex = <class 'str'> val=
y=
主要言語
Python
スター
653
フォーク
217
平均マージ
2日 21時間
マージ済み PR(30日)
2

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

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

はじめの一歩

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

ipython/traitlets のほかの issue

ipython/traitlets の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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