Python Glossary Русский

all Python 3platformfunction

platform.python_revision()

interpreter

The source revision (commit hash) the interpreter was built from; often an empty string.

Syntax

platform.python_revision()

Like python_branch(), this is git information captured at build time, and distribution builds usually lack it. It helps CPython developers reproduce a bug exactly; an application has nothing to decide by it. Take the language version from python_version() or sys.version_info.

Examples

import platform
print(repr(platform.python_revision()))  # → ? хеш коммита или ''
print(type(platform.python_revision()).__name__)  # → str

See also

Open in the full glossarydocs.python.orgReport an inaccuracy