I was preforming some doctests in PyCharm and I ran the test in the python console. It passes one and fails the other, but the failure shows the value returned being the correct value. Does anyone know what I might be missing or if this is a known error in PyCharm, etc?
Here is the code
def friend_date(a, b):
"""
Returns True if they have any hobbies in common, False is not.
>>> elmo = ('Elmo', 5, ['hugging', 'being nice'])
>>> sauron = ('Sauron', 5000, ['killing hobbits', 'chess'])
>>> gandalf = ('Gandalf', 10000, ['waving wands', 'chess'])
>>> friend_date(elmo, sauron)
False
>>> friend_date(sauron, gandalf)
True
"""
return bool(set(a[2]) & set(b[2]))
Trueline has a trailing space. That matters.