Are you sure you want to change the dictionary in place? You can easily create a new one (thanks to iterators, without even touching objects that you don't need):
OrderedDict(itertools.islice(d.iteritems(), 500))
You can also trim the original one, but that would be less effective for the big one and would probably not be necessary. The semantics are different if someone uses d , of course.
source share