0
I am trying to count the amount of dictionaries exists in a list. However the condition always of false in the if.
>>> type(record['TranslationStack'][0])
<class 'Bio.Entrez.Parser.DictionaryElement'>
>>> record['TranslationStack'][0]
{'Field': 'MeSH Terms', 'Count': '506695', 'Explode': 'Y', 'Term': '"nucleotides"[MeSH Terms]'}
>>> type(record['TranslationStack'][0]) is dict
False
Bio.Entrez.Parser.DictionaryElement
refers to an element, item of a Dict (reading the name) and not to adict
, which is a set of elements. maybetype(record['TranslationStack'][0]) is Bio.Entrez.Parser.DictionaryElement
is more likely to function.– Michelle Akemi
It didn’t work. False Returns
– user2535338