gvwilson / sdxpy

Software Design by Example: a tool-based introduction with Python
https://third-bit.com/sdxpy/
Other
280 stars 49 forks source link

Figure 3.1 is incorrect #261

Closed Hofer-Julian closed 6 months ago

Hofer-Julian commented 6 months ago

The following snippet is described by Figure 3.1

def find_duplicates(filenames):
    matches = []
    for i_left in range(len(filenames)):
        left = filenames[i_left]
        for i_right in range(i_left):
            right = filenames[i_right]
            if same_bytes(left, right):
                matches.append((left, right))
    return matches

grafik

However, as far as I can tell, the following fields are looped through:

Neues Dokument - Selection

gvwilson commented 6 months ago

thank you - I'll push a fix on the weekend.