Skip to content

Posts

Invalidate a cached Python property when its inputs change

Delete a cached_property result when replacing its inputs, and validate the replacement before changing the object.

Read more →

November 16, 2026

SQLite: Make last_value Read the End of the Partition

A sensor report needs each reading beside that sensor’s final reading. An ordered last_value call can return the current reading instead. The frame must extend to the end of the …

Read more →

November 15, 2026

SQLite: Keep NULL from Hiding Unmatched Rows

A report that excludes blocked IDs can unexpectedly return no rows when the blocked list contains a missing ID. Inspect the NULL policy on both sides before choosing an exclusion …

Read more →

November 15, 2026

SQLite: Handle a Deferred Foreign-Key Failure at COMMIT

A deferred foreign key allows a child row to arrive before its parent inside a transaction. If the parent is still missing at COMMIT, the commit fails and the transaction remains …

Read more →

November 15, 2026

Reject Fractional Cents with Python Decimal

A payment import can require exact cents even when a calculation elsewhere permits rounding. Trap Inexact during quantize() to reject a value that would lose nonzero digits. Tested …

Read more →

November 15, 2026

Recalculate Derived Fields with dataclasses.replace

When an order quantity changes, its stored total must change too. dataclasses.replace() creates a new instance through its initializer, so __post_init__() can recalculate an …

Read more →

November 15, 2026

Preserve Inventory Deficits with Counter.subtract

Subtracting an order from stock can produce both remaining stock and shortages. Counter subtraction operators discard nonpositive results, which can hide shortages in an audit. Use …

Read more →

November 15, 2026

Node.js: Save Buffer bytes before reusing their parent

Copy a Buffer view when its bytes must survive changes to the original allocation.

Read more →

November 15, 2026

Node.js: Reject repeated command-line options

Use parseArgs tokens to reject duplicate options, including mixed short and long names.

Read more →

November 15, 2026

Node.js: Keep synchronous task failures in a batch report

Wrap task invocation in a promise callback so allSettled can report both thrown errors and rejected promises.

Read more →

November 15, 2026