Coding tips
AttributeError: 'NoneType' object has no attribute in Python: 10 Causes and Fixes, from sort() and re.match to dict.get (Tested Examples)
Python raises AttributeError: 'NoneType' object has no attribute when a variable you expected to hold an object holds None instead. Here are 10 real causes, from list.sort() and functions without return to re.match and dict.get, with tested output and the fix for each.