Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python can you put try except in list comprehension

def catch(func, *args, handle=lambda e : None, **kwargs):  
     try:  
         return func(*args, **kwargs)  
     except Exception as e:  
         return handle(e)
Source by dev.to #
 
PREVIOUS NEXT
Tagged: #python #put #list #comprehension
ADD COMMENT
Topic
Name
1+1 =