AttributeError

The exception raised when code asks an object for a method or attribute it does not have.

In more detail

Common causes are a misspelt method name, calling a string method on a list, or a variable that is None because a function returned nothing, as in 'NoneType' object has no attribute 'append'. Check the type of the object with type(x) and the available names with dir(x).

Related terms

Taught in

References

Certification courses