use of singletons in 0.9 causes non-intuitive folding of constants
Issue #3170
resolved
from sqlalchemy import select, null
from sqlalchemy.sql.elements import Null
print select([null(), null()])
print select([Null(), Null()])
SELECT NULL AS anon_1
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)
-
reporter -
reporter - attached 3170.patch
simple and all the tests pass so I think we should just go with it. i think its OK for 0.9.8.
-
reporter - changed milestone to 1.0
- edited description
gotta be really conservative with 0.9 at this point
-
reporter - changed status to resolved
- 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>>
- Log in to comment
interestingly, this is OK:
I think we have to just get rid of the singleton