diff --git a/import sys.py b/import sys.py new file mode 100644 index 0000000..daa4292 --- /dev/null +++ b/import sys.py @@ -0,0 +1,16 @@ +import sys +import sysconfig + +print(f"Python Version: {sys.version}") + +# 检查 GIL 状态 +try: + # Python 3.13+ free-threading build 才有这个属性 + is_gil_enabled = sys._is_gil_enabled() + print(f"GIL Enabled: {is_gil_enabled}") +except AttributeError: + print("GIL Status: Unknown (sys._is_gil_enabled not found, likely GIL-enabled build)") + +# 检查 JIT 状态 +# 目前没有直接的 API 检查 JIT 是否开启,通常看性能或启动日志 +print("JIT Support: Experimental (Enable with -X jit)") \ No newline at end of file diff --git a/x = 5.py b/x = 5.py new file mode 100644 index 0000000..cc45750 --- /dev/null +++ b/x = 5.py @@ -0,0 +1,10 @@ +x = 5 + +# 它有自己的身份 +print(id(x)) + +# 它有自己的类型 +print(type(x)) + +# 它甚至有自己的工具! +print(x.bit_length()) \ No newline at end of file