On Friday, June 3, 2016 at 3:20:42 PM UTC+1, Sayth Renshaw wrote:

>     pyqFiles = []
>     for filename in sorted(file_list):
>         pyqFiles = pyqFiles.append(pq(filename=my_dir + filename))

This won't end well. The return value from [].append(...) is None.

>>> [].append(0) is None
True

The first time through the loop pqFiles is set to the return value of 
pqFile.append(...), which is None. 

The second time through, you'll get:
AttributeError: 'NoneType' object has no attribute 'append'


-- 
Jonathan
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to