MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / _create_singleton

Method _create_singleton

lib/sqlalchemy/sql/base.py:225–237  ·  view source on GitHub ↗
(cls)

Source from the content-addressed store, hash-verified

223
224 @classmethod
225 def _create_singleton(cls) -> None:
226 obj = object.__new__(cls)
227 obj.__init__() # type: ignore
228
229 # for a long time this was an empty frozenset, meaning
230 # a SingletonConstant would never be a "corresponding column" in
231 # a statement. This referred to #6259. However, in #7154 we see
232 # that we do in fact need "correspondence" to work when matching cols
233 # in result sets, so the non-correspondence was moved to a more
234 # specific level when we are actually adapting expressions for SQL
235 # render only.
236 obj.proxy_set = frozenset([obj])
237 cls._singleton = obj
238
239
240def _from_objects(

Callers 1

elements.pyFile · 0.80

Calls 2

__new__Method · 0.45
__init__Method · 0.45

Tested by

no test coverage detected