[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

I'm wrong or Will we fix the ducks limp?

Very briefly because I hope to shot down eloquently.

Python is beautiful and is supposed to be a duck typed language, Yes?

Then if I create and assign to a new variable with a list action why does the duck not quack?

It feels wrong to spend a line writing what is already obvious

def getsMeet(files=file_list):
    """Get a File or List of Files.

    From the list of files determine
    what meetings exist and prepare them
    to be parsed
    pyqFiles = []
    for filename in sorted(file_list):
        pyqFiles = pyqFiles.append(pq(filename=my_dir + filename))

    return pyqFiles

Here I have to write that pyqFiles is a list before I take an explicit list action and append to it, if i create a variable and make it quack a list isn't it a list?

Assuming the answer is going to be that some methods apply to multiple types if not then what is happening?


PS I am really having a lot of fun coding.