On the weight of a topological space