From: dvarrazzo (@dvarrazzo) <noreply+dvarrazzo@github.com>
To: psycopg/psycopg <noreply+psycopg-psycopg@github.com>
Subject: [psycopg/psycopg] PR #1494: Build loaded UUIDs by writing their slots directly
Date: Wed, 11 Nov 2026 14:48:30 +0000
Message-ID: <gh-psycopg-psycopg-1494@github.com> (raw)
Build the int in a single call from the 16 bytes instead of shifting and or-ing two halves, and store `int` and `is_safe` straight into the UUID slots, whose offsets are read from the type descriptors. This replaces the writable subclass hack.
Raise an error if the UUID layout is not the expected one. Keep a slower setattr-based version, unused, for a possible Limited API build.
Replace #1272