Message356169
A subscriptable object is any object that implements the __getitem__ special method (think lists, dictionaries). It is an object that records the operations done to it and it can store them as a "script" which can be replayed. You are trying to subscript an object which you think is a list or dict, but actually is None. NoneType is the type of the None object which represents a lack of value, for example, a function that does not explicitly return a value will return None. 'NoneType' object is not subscriptable is the one thrown by python when you use the square bracket notation object[key] where an object doesn't define the __getitem__ method . You might have noticed that the method sort() that only modify the list have no return value printed – they return the default None. This is a design principle for all mutable data structures in Python. http://net-informations.com/python/err/nonetype.htm |
|
Date |
User |
Action |
Args |
2019-11-07 05:49:44 | larabrian | set | recipients:
+ larabrian, barry, Dutcho, xtreak |
2019-11-07 05:49:44 | larabrian | set | messageid: <1573105784.63.0.926114799222.issue36406@roundup.psfhosted.org> |
2019-11-07 05:49:44 | larabrian | link | issue36406 messages |
2019-11-07 05:49:44 | larabrian | create | |
|