-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: [Python] 「存在しないコンストラクタ」についてケア (#988)
現在`VoiceModelFile`と`Onnxruntime`には通常のコンストラクタが存在しな い。正確に言えば`__new__`は存在してはいるが、それを呼ぶと`TypeError`にな る。その「存在しないコンストラクタ」について次の2つを行う。 1. エラーメッセージ (`TypeError`)の改善。 PyO3か何かが出しているやつから改善する。 2. pyiに`__new__`について記述。 シグネチャは`(cls, *args, **kwargs) -> NoReturn`。**これをやらないと デフォルトコンストラクタ (`() -> Self`)が存在することになってしま う**。ちなみにPyright/Pylanceとmypy(多分)にのみ影響。Sphinxには `__new__`の記述は無視されてしまった。
- Loading branch information
Showing
3 changed files
with
58 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters