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

Change optional boolean properties, such as `deleted`, to real booleans

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

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

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

評価

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

調査の方向性

deleted などのオプションプロパティを定義している StripeObject のサブクラスを特定し、関連する型定義とテストを調査します。これらのプロパティが存在しない場合にどのように表現されるかを確認し、呼び出し元が boolean としてアクセスできるよう、影響を受けるアノテーションと動作を更新します。完了の条件は、関連するテストで getattr を使わない直接的な boolean アクセスがカバーされていることです。

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

説明

feature-request future
Is your feature request related to a problem? Please describe.

Whenever a StripeObject subclass has the deleted property, it's optional and can ever only be True:

deleted: Optional[Literal[True]]
"""
Always true for a deleted object
"""

This means that if I want to check if a customer was deleted for example, I need to use getattr(customer, "deleted", False) instead of simply customer.deleted (because that could raise an AttributeError).

Describe the solution you'd like

Now that StripeObject isn't simply a subclass of dict anymore, can't the SDK simplify these sort of booleans? Turn them from optional booleans that can only be True to real booleans?

Describe alternatives you've considered

No response

Additional context

No response

主要言語
Python
スター
2.1k
フォーク
538
平均マージ
2日 16時間
マージ済み PR(30日)
28

環境構築

はじめの一歩

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

stripe/stripe-python のほかの issue

stripe/stripe-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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