Merge branch 'main' into dev

This commit is contained in:
镀铬酸钾
2026-01-13 08:37:23 +08:00
committed by GitHub
2 changed files with 26 additions and 0 deletions

16
import sys.py Normal file
View File

@@ -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)")

10
x = 5.py Normal file
View File

@@ -0,0 +1,10 @@
x = 5
# 它有自己的身份
print(id(x))
# 它有自己的类型
print(type(x))
# 它甚至有自己的工具!
print(x.bit_length())