Pythonスクリプトを見て(または実行して)、各行(または関数)に必要なPythonのバージョンを判断する、Pylintに似たものはありますか?
たとえば、理論上の使用法:
$ magic_tool <EOF
with something:
pass
EOF
1: 'with' statement requires Python 2.6 or greater
$ magic_tool <EOF
class Something:
@classmethod
def blah(cls):
pass
EOF
2: classmethod requires Python 2.2 or greater
$ magic_tool <EOF
print """Test
"""
EOF
1: Triple-quote requires Python 1.5 of later
そのようなことは可能ですか?最も簡単な方法は、すべての Python バージョンをディスクに保存し、それぞれのバージョンでスクリプトを実行して、どのようなエラーが発生するかを確認することだと思います..