将 .py 和 .pyi 后缀名改为了 .vp 和 .vpi 后缀名

This commit is contained in:
2026-07-30 16:33:56 +08:00
parent f79c8ca643
commit cfc30d735c
322 changed files with 246 additions and 31772 deletions

19
includes/ctraits.vpi Normal file
View File

@@ -0,0 +1,19 @@
"""ctraits — Compile-time type trait library
Provides compile-time type predicates with no runtime code generated.
All functions are evaluated exclusively at compile time and can be combined with conditional compilation constructs such as c.CIf.
"""
import t
def isptr(x: t.CType) -> bool:
"""Compile-time predicate to determine whether the type of x is a pointer.
Returns True if x is a pointer type (ptr_count > 0); otherwise returns False.
Can be used alongside c.CIf to implement conditional compilation.
Example:
if c.CIf(ctraits.isptr(my_var)):
# This branch compiles only when my_var is a pointer type
...
"""
pass