MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _create_singleton

Method _create_singleton

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

Source from the content-addressed store, hash-verified

235
236 @classmethod
237 def _create_singleton(cls) -> None:
238 obj = object.__new__(cls)
239 obj.__init__() # type: ignore
240
241 # for a long time this was an empty frozenset, meaning
242 # a SingletonConstant would never be a "corresponding column" in
243 # a statement. This referred to #6259. However, in #7154 we see
244 # that we do in fact need "correspondence" to work when matching cols
245 # in result sets, so the non-correspondence was moved to a more
246 # specific level when we are actually adapting expressions for SQL
247 # render only.
248 obj.proxy_set = frozenset([obj])
249 cls._singleton = obj
250
251
252def _from_objects(

Callers 1

elements.pyFile · 0.80

Calls 2

__new__Method · 0.45
__init__Method · 0.45

Tested by

no test coverage detected