您的位置:首页 > 编程语言 > Python开发

[python] 高效使用assert

2014-12-06 20:18 260 查看
Places to consider putting assertions:

checking parameter types, classes, or values

checking data structure invariants

checking "can't happen" situations (duplicates in a list, contradictory state variables.)

after calling a function, to make sure that its return is reasonable
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: