<p>在许多语言(和地方)中,通过创建类似<a href="https://stackoverflow.com/questions/541705/is-iftrue-a-good-idea-in-c">this</a>的块来创建本地作用域是一种很好的做法。</p>
<pre><code>void foo()
{
... Do some stuff ...
if(TRUE)
{
char a;
int b;
... Do some more stuff ...
}
... Do even more stuff ...
}
</code></pre>
<p>如何在python中实现这一点,而不出现意外的缩进错误,也不使用某种<a href="https://stackoverflow.com/questions/541705/is-iftrue-a-good-idea-in-c"><em>if True:</em></a>技巧</p>