(original) (raw)
I agree with everything Steven says. But it's true that even as a 20-year Python user, this is an error I make moderately often when I want an empty set... Notwithstanding that I typed it thousands of times before sets even existed (and still type it when I want an empty dictionary).That said, I've sort of got in the habit of using the type initializers:x = set()y = dict()z = list()I feel like those jump out a little better visually. But I'm inconsistent in my code.
Yeah, we've been doing that for several years, too. A hair slower in some cases, but much more greppable...