From: dvarrazzo (@dvarrazzo) <noreply+dvarrazzo@github.com>
To: psycopg/psycopg <noreply+psycopg-psycopg@github.com>
Subject: Re: [psycopg/psycopg] PR #1498: fix: raise DataError dumping out-of-range ints to binary int2 or int4
Date: Tue, 17 Nov 2026 14:26:54 +0000
Message-ID: <gh-psycopg-psycopg-1498-rc4600933164@github.com> (raw)
In-Reply-To: <gh-psycopg-psycopg-1498@github.com>
References: <gh-psycopg-psycopg-1498@github.com>
(on psycopg/psycopg/types/numeric.py:172)
Better try and raise `DataError ... from None` because setting the exception and not raising is a cheap operation in Python.