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

Hypothesis integration

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

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python
領域
testing

調査の方向性

まず、参照されている returns/contrib/hypothesis/laws.py を読み、このプロジェクトに既存の typeclass と mypy のチェックと比較してください。提案されている check_typeclass 戦略と、その allow_instances、allow_protocols、allow_unknown オプションを定義し、サポートされているケースでは有効な戻り値の型が生成され、サポートされていないケースでは NotImplementedError が生成されることを確認してください。

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

説明

enhancement

Right now we don't test classes with hypothesis at all.

But, I have a great idea (at least it seems to me like so) of adding a hypothesis plugin, similar to one we have in returns: https://github.com/dry-python/returns/blob/master/returns/contrib/hypothesis/laws.py

What should it do?

  • check_typeclass(typeclass_instance) will check that for all existing types and protocols some valid return type is produced. For example, @typeclass def some(instance) -> str must produce str for all instance, protocol, and supported types and it must produce NotImplementedError for types that are not supported
  • Looks like check_typeclass must have allow_instances, allow_protocols, allow_unknown kw bool arguments to configure what types we actually need in a resulting strategy

It would be a nice companion to our mypy check.

@Zac-HD do you like it? Maybe you have any other ideas?

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

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

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

はじめの一歩

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

dry-python/classes のほかの issue

dry-python/classes の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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