---
title: "Discussion on \"truthassert: The PythonAssert That Can Never Fail\" | Hashnode"
description: "Discussion on \"truthassert: The PythonAssert That Can Never Fail\". assert (cond, \"msg\") asserts a tuple, and a tuple is always true, so the check never fires. A tiny AST gate catches it in CI."
url: "https://hashnode.com/posts/truthassert/6b0c535ea53f32c229b3dbc1"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [truthassert: The PythonAssert That Can Never Fail](https://jaytank.hashnode.dev/truthassert?utm_source=hashnode&utm_medium=feed)

assert (cond, "msg") asserts a tuple, and a tuple is always true, so the check never fires. A tiny AST gate catches it in CI.

3d ago · 6 min read · jaytank.hashnode.dev  
Read the article

-   [#python](https://hashnode.com/tag/python)
-   [#testing](https://hashnode.com/tag/testing)
-   [#static-analysis](https://hashnode.com/tag/static-analysis)
-   [#programming-blogs](https://hashnode.com/tag/programming-blogs)
-   [#software-engineering](https://hashnode.com/tag/software-engineering)

## Written by

[JAY TANK](https://hashnode.com/@jaytank)

@jaytank

  
[View profile](https://hashnode.com/@jaytank)

Engineering insights on building and scaling modern software.

Cloud &amp; Platform Engineer focused on building systems that scale and endure. I explore how infrastructure, automation, and engineering practices come together to support modern software teams.

## Responses 1

Markdown supported · ⌘↵ to post

[Salman Parvez | ML Systems](https://hashnode.com/@ml-systems)

[3d ago](https://hashnode.com/posts/truthassert/6b0c535ea53f32c229b3dbc1/comment/6b0c77295fecb4bd472cb08a)

"The comfort of a guard without the guard" is the line I'd keep. Coming from carpentry and estimating, this is an inspection sticker that got printed before the inspector showed up. Everyone after that builds on it, and the failure turns up three trades later, far from the check that was supposed to catch it. The comma inside the parentheses being the whole bug is a good example of why reading the tree beats reading the text. It looks right to a person, which is how it gets past review. I direct agents as a Language Modeler, and a check that can't fail is the first thing I look for in generated tests. Narrow tools that catch one thing are easy to trust.
