sor*_*rin 7 python python-module
我想知道是否有一种编写以下模块代码的方法,而无需在整个模块代码中添加另一个缩进级别.
# module code
if not condition:
# rest of the module code (big)
Run Code Online (Sandbox Code Playgroud)
我正在寻找这样的东西:
# module code
if condition:
# here I need something like a `return`
# rest of the module code (big)
Run Code Online (Sandbox Code Playgroud)
注意,我不想抛出异常,导入应该正常传递.