28
loading...
This website collects cookies to deliver better user experience
def create(item):
try:
item("creating")
except:
pass
def create(item):
try:
item("creating")
except Exception:
pass
Bare except will catch exceptions you almost certainly don't want to catch, including KeyboardInterrupt (the user hitting Ctrl+C) and Python-raised errors like SystemExit
from package_a import *
from package_b import *
# suppose both packages included a function named pretty_print
# it is unclear which method is invoked below
pretty_print("abc")
from package_a import pretty_print
from package_b import other_function_required
pretty_print("abc")