MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / coerce

Method coerce

lib/sqlalchemy/ext/mutable.py:1063–1070  ·  view source on GitHub ↗

Convert plain set to instance of this class.

(cls, index: str, value: Any)

Source from the content-addressed store, hash-verified

1061
1062 @classmethod
1063 def coerce(cls, index: str, value: Any) -> Optional[MutableSet[_T]]:
1064 """Convert plain set to instance of this class."""
1065 if not isinstance(value, cls):
1066 if isinstance(value, set):
1067 return cls(value)
1068 return Mutable.coerce(index, value)
1069 else:
1070 return value
1071
1072 def __getstate__(self) -> Set[_T]:
1073 return set(self)

Callers 4

loadMethod · 0.45
set_Method · 0.45
coerceMethod · 0.45
coerceMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected