Python item type Changes Randomly?

Viewed 37

Something really strange is happening with my python script, and item type gets changed without clear reason.

I have:

for key in match_phrases:
    for phrase in match_phrases[key]:
        print(match_phrases[key])
        print(phrase)
        assert isinstance(phrase, str) #FAILS TUPLE

first print command prints:

['DEVICE NAME', 'PRODUCT NAME', 'PRINTER NAME', 'IP CAMERA NAME', 'ROUTER NAME']

then second one prints:

(1, 'PLEASE CONFIGURE THE PASSWORD')

where did that values came from?

I'm expecting it to iterate over the list's values ie: 'DEVICE NAME' etc...

0 Answers
Related