📄 testraise.py
字号:
class fooexception(Exception):
def __init__(self, msg):
Exception.__init__(self)
print msg
def __init__(self):
Exception.__init__(self)
print "i am a fooexception"
data = 2
raise "foo"
raise "foo", data
# before
raise fooexception # on-line
# after
# before
raise fooexception, "bla" # on-line
# after
raise fooexception, [1, 2, 3]
raise fooexception, range(3)
raise fooexception, (1, 2, 3)
raise fooexception, (1, 2, 3), 1
# after
raise fooexception, (1, 2, 3), "foo" # on-line
# after
raise fooexception, (1, 2, 3), (1, 2, 3)
raise fooexception, (1, 2, 3), [1, 2, 3]
# after
raise fooexception, (1, 2, 3), range(1) # on-line
# after
raise fooexception, (1, 2, 3), (1 + 1)
raise
raise fooexception, (1, 2, 3), 1 + 1
raise
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -