Python 3 has vocabulary keywords instead, a much more powerful concept. Your code can be written as
some_dict.keys() & another_dict.keys()
in Python 3.x. This returns the shared keys of the two dictionaries as a set.
It is also available in Python 2.7 using the method dict.viewkeys().
:
[key for key in some_dict if key in another_dict]
dict.__contains__(), , in:
filter(another_dict.__contains__, some_dict.keys())
, , . , , some_dict another_dict.