Why is the dictionary key being converted to a inherited class type – stackoverflow.com

My code looks something like this class SomeClass(str): pass some_dict = {'s':42} >>> type(some_dict.keys()[0]) str >>> s = SomeClass('s') >>> some_dict[s] = 40 ...

from Hot Questions - Stack Exchange OnStackOverflow
via Blogspot

Share this

Artikel Terkait

0 Comment to "Why is the dictionary key being converted to a inherited class type – stackoverflow.com"