docs: 新增「类型约定」章节(架构 §4.7)
把"数据类型必须明确"从口头要求变成仓库规则,每个函数都适用。 - 判断顺序表:整数用 (int, np.integer)、浮点用 (float, np.floating)、 bool 要放在 int 判断之前、数组先 np.asarray 归一化 - 硬规则:非法类型必须 raise TypeError,不许静默兜底 (静默的后果是"种子被忽略、结果不可复现且无提示",最难查) - 要求每个公开函数写全 Parameters(含 None 走哪条分支)与 Raises - docs/03-roadmap.md §3.2 开发纪律加一行指针
This commit is contained in:
1 parent
c93810ffb1
commit
98278edd77
3 files changed
+28
No files matched your search
@@ -86,6 +86,7 @@
|
||||
|
||||
1. 先想"这道题里它替代了哪段手写代码"——想不出来就先不写。
|
||||
2. 先在 `tests/` 里写一条会失败的断言(测已知解析解,不测实现细节)。
|
||||
- 参数类型注解按 `02-architecture.md` §4.7 写全;非法类型抛 `TypeError`,不静默兜底。
|
||||
3. 实现到测试通过。
|
||||
4. 在 `examples/` 里加一行最小用法。
|
||||
5. 更新 `STATUS.md`。
|
||||
|
||||
Reference in new issue
Block a user