I was fiddling with dict() and found out that when I do
>>> dict({4:None})
it returns
{4: None}
which is expected but,
when I try converting a list containing a nested set [{4,None}]
>>> dict([{4,None}])
returns
{None: 4}
which genuinely unexpected.
Then I checked that it only happens with few integers. That is crazy.
e.g. dict([{5,None}])
returns {None: 5}
dict([{6,None}])
returns {None: 6}
dict([{7,None}])
returns {None: 7}
although
dict([{8,None}])
returns {8: None}
dict([{9,None}])
returns {9: None}
Can anyone answer this? I am using Python 3.11