'Extend this collection with the joins from another collection
@param other: the other collection (S3Joins), or a dict like
{tablename: [join, join]}
@return: the list of names of all tables for which joins have
been added to the collection'

def extend(self, other):

    if (type(other) is S3Joins):
        add = self.tables.add
    else:
        add = None
    joins = (self.joins if (type(other) is S3Joins) else self)
    for tablename in other:
        if (tablename not in self.joins):
            joins[tablename] = other[tablename]
            if add:
                add(tablename)
    return other.keys()
