1. Michael Bayer
  2. sqlalchemy
  3. Issues


Issue #3170 resolved

use of singletons in 0.9 causes non-intuitive folding of constants

Michael Bayer
repo owner created an issue
from sqlalchemy import select, null

from sqlalchemy.sql.elements import Null

print select([null(), null()])

print select([Null(), Null()])
SELECT NULL AS anon_1, NULL AS anon_2

this is due to the singleton.

it's totally a regression, so this is critical that something is figured out.

Comments (4)

  1. Michael Bayer reporter
    • Reversing a change that was made in 0.9, the "singleton" nature of the "constants" :func:.null, :func:.true, and :func:.false has been reverted. These functions returning a "singleton" object had the effect that different instances would be treated as the same regardless of lexical use, which in particular would impact the rendering of the columns clause of a SELECT statement. fixes #3170

    → <<cset ade27f35cb49>>

  2. Log in to comment