Because you allow iterators in. You could define a new dictionary vocab and use its setdefault method, then rename it to vocabulary. A little more memory efficient I guess.