Why do I get AttributeError: 'NoneType' object has no attribute 'something'?

前端 未结 10 2040
长情又很酷
长情又很酷 2020-11-21 13:36

I keep getting an error that says

AttributeError: \'NoneType\' object has no attribute \'something\'
10条回答
  •  你的背包
    2020-11-21 13:55

    The NoneType is the type of the value None. In this case, the variable lifetime has a value of None.

    A common way to have this happen is to call a function missing a return.

    There are an infinite number of other ways to set a variable to None, however.

提交回复
热议问题