AttributeError Python

Введение

Официальная документация

exception AttributeError

Raised when an attribute reference (see Attribute references) or assignment fails. (When an object does not support attribute references or attribute assignments at all, TypeError is raised.)

The name and obj attributes can be set using keyword-only arguments to the constructor. When set they represent the name of the attribute that was attempted to be accessed and the object that was accessed for said attribute, respectively.

Changed in version 3.10: Added the name and obj attributes.

Разобранные AttributeError
AttributeError: partially initialized module 'datetime' has no attribute 'date'
AttributeError: 'str' object has no attribute 'items'
Изображение баннера

Автор статьи: Андрей Олегович