ENB: The Big Little Lie

8 views
Skip to first unread message

Edward K. Ream

unread,
7:14 AM (11 hours ago) 7:14 AM
to leo-editor
This Engineering Notebook post discusses rev 0012773b0 of PR #4812.

I call this rev the "Big Little Lie" in honor of Liane Moriarty, the author of a book by that name. I am now reading another of her books, Here One Moment, for the fourth time.

The Big Little Lie annotates p.v as a VNodenot as VNode | None. Why would I do that, you ask?

My reasoning is straightforward. Leo already raises ValueError in those few places where it's imperative to fail fast, before data might be corrupted. But in all other cases, mypy pedantically wants the code to assert p.v in places where Leo would immediately raise AttributeError if p.v were None. These useless assertions pollute Leo's code to no purpose. I shall soon remove them from PR #4812.

All your comments, questions, and suggestions are welcome.

Edward

Edward K. Ream

unread,
8:02 AM (10 hours ago) 8:02 AM
to leo-editor
On Thursday, July 23, 2026 at 6:14:55 AM UTC-5 Edward K. Ream wrote:

> These useless assertions pollute Leo's code to no purpose. I shall soon remove them from PR #4812.

Well, that was straightforward. Starting with the clone-diff-pr command, a few find/replace commands deleted the unnecessary asserts.

See rev  ab98042d. The rev deletes fewer asserts than I expected, but I think the cleanups are worthwhile.

Edward
Reply all
Reply to author
Forward
0 new messages