I create a dictionary,
d = {'a': 1, 'b': 2, 'c': 3, 'f': 6}
when I use dir on its values,
print(dir(d.values()))
it gives,
['__class__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__',
'__ge__', '__getattribute__', '__gt__', '__hash__', '__init__',
'__init_subclass__', '__iter__', '__le__', '__len__', '__lt__', '__ne__',
'__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__',
'__sizeof__', '__str__', '__subclasshook__']
but how exactly is the __ge__ supposed to be used? (and similarly, __gt__, __le__, ...)
as when I do,
e = {'w': 5, 'x': 6, 'y': 7, 'z': 8}
print(d.values() >= e.values())
it gives,
TypeError: '>=' not supported between instances of 'dict_values' and 'dict_values'
similar error appears if I compare dict_values with dict or set or list or ...
carrying a similar experiment with d.keys() gives a result,
print(d.keys() >= e.keys())
gives,
False
and if I change,
e = {1: 2, 3: 4, 5: 6}
print(d.keys() >= e.keys())
gives,
False
but should it not raise an error, comparing string to int, and furthermore, len(d.keys()) is not equal to len(e.keys())?