修复了大量存在的问题,增加了假鸭子类型等等机制

This commit is contained in:
2026-06-25 14:49:46 +08:00
parent 19f2787db0
commit d88d11b646
827 changed files with 32617 additions and 18316 deletions

View File

@@ -0,0 +1,25 @@
"""
Auto-generated Python stub file from testcheck.py
Module: testcheck
"""
import t, c
import stdio
_pass_count: t.CExtern | t.CInt
_fail_count: t.CExtern | t.CInt
def begin(name: str) -> t.CInt: pass
def section(name: str) -> t.CInt: pass
def ok(msg: str) -> t.CInt: pass
def fail(msg: str) -> t.CInt: pass
def check(cond: t.CInt, ok_msg: str, fail_msg: str) -> t.CInt: pass
def info(msg: str) -> t.CInt: pass
def end() -> t.CInt: pass

View File

@@ -1,2 +1,3 @@
1348b0e29ea228ad:main.py
73edbcf76e32d00b:includes/stdio.py
9dbecd0942a39782:includes/testcheck.py
d2165a80fd5563cc:main.py

View File

@@ -7,6 +7,7 @@ Module: main
import t
import stdio
import c
import testcheck
def square[T](x: T) -> T: pass
@@ -18,7 +19,7 @@ def test_generic_clamp() -> t.CInt: pass
class Stack[T]:
data: list[t.CInt, 16]
data: t.CArray[t.CInt, 16]
top: t.CInt
def __init__(self: Stack) -> t.CInt: pass
def push(self: Stack, val: T) -> t.CInt: pass
@@ -46,7 +47,7 @@ class Range[T]:
def test_generic_range() -> t.CInt: pass
def array_sum(arr: list[t.CInt, 8], n: t.CInt) -> t.CInt: pass
def array_sum(arr: t.CArray[t.CInt, 8], n: t.CInt) -> t.CInt: pass
def test_generic_array_sum() -> t.CInt: pass
@@ -56,7 +57,7 @@ def test_generic_max_three() -> t.CInt: pass
class Container[T]:
values: list[t.CInt, 8]
values: t.CArray[t.CInt, 8]
size: t.CInt
def __init__(self: Container) -> t.CInt: pass
def add(self: Container, v: T) -> t.CInt: pass