Python 3.2.3. There were some ideas listed here, which work on regular var\'s, but it seems **kwargs play by different rules... so why doesn\'t this work and how can I check
It is just this:
if 'errormessage' in kwargs:
print("yeah it's here")
You need to check, if the key is in the dictionary. The syntax for that is some_key in some_dict (where some_key is something hashable, not necessarily a string).
The ideas you have linked (these ideas) contained examples for checking if specific key existed in dictionaries returned by locals() and globals(). Your example is similar, because you are checking existence of specific key in kwargs dictionary (the dictionary containing keyword arguments).