No, kwargs.get('somestring')
will not raise an exception; you are passed a standard Python dict
type in that case.
Is there a reason to wrap kwargs.get() with a try except statement in python?
-
02-06-2022 - |
Вопрос
If I define a function, is it ever possible that an exception would be raised for kwargs.get? For example,
def func(**kwargs):
try:
a = kwargs.get("a")
except Exception as e:
raise ValueError("Would I ever see this error? \n ERROR: %s" % e )
Решение
Не связан с StackOverflow