我希望在我提交给Mercurial的一些python脚本中使用版本记账。你知道吗
我打算按照https://www.python.org/dev/peps/pep-0008/#version-bookkeeping中的说明操作,但我不确定
before any other code, separated by a blank line above and below.
指进口前。是吗?我这么问是因为有些进口商品似乎必须放在最开始的时候,例如:
from __future__ import print_function, division, absolute_import, unicode_literals
import
语句是代码。您可以将它们放在try
/except
语句中以捕获ImportError
,不太常见的情况下,它们可以在函数和类语句中使用。所以这在模块docstring之后,在导入之前。你知道吗__future__
语句不仅仅是普通代码。编译器(与解释器相反)和have to come before you start assigning variables or importing other modules可以理解它们:因此,如果您的版本控制crud是一个注释,您可以将它放在将来的语句之前。但如果它是一个真正的变量,它就必须去追求。你知道吗
相关问题 更多 >
编程相关推荐