エラーコードポータル
PythonPythonエラーコード

TypeError

TypeError

コード TypeError · Pythonが報告した問題です。

操作または関数が不適切な型のオブジェクトに適用された場合に発生します。関連付けられた値は、タイプの不一致に関する詳細を示す文字列です。 この例外は、オブジェクトに対して試行された操作がサポートされておらず、サポートされることを意図していないことを示すためにユーザー コードによって発生する場合があります。オブジェクトが特定の操作をサポートすることを目的としているが、実装がまだ提供されていない場合、NotImplementedError が発生する適切な例外です。 間違った型の引数を渡すと (例: int が期待されるときにリストを渡す)、TypeError が発生しますが、間違った値の引数を渡すと (例: 期待される境界外の数値) は ValueError が発生します。

Google Translate · 自動翻訳です。専門用語や適用条件は英語の原文で確認してください。

Raised when an operation or function is applied to an object of inappropriate type. The associated value is a string giving details about the type mismatch. This exception may be raised by user code to indicate that an attempted operation on an object is not supported, and is not meant to be. If an object is meant to support a given operation but has not yet provided an implementation, NotImplementedError is the proper exception to raise. Passing arguments of the wrong type (e.g. passing a list when an int is expected) should result in a TypeError, but passing arguments with the wrong value (e.g. a number outside expected boundaries) should result in a ValueError.

トラブルシューティング・診断リンク

まず、文書の製品・バージョン・発生環境が現在の状況と一致しているか確認してください。