MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / pop

Method pop

lib/sqlalchemy/orm/attributes.py:1928–1942  ·  view source on GitHub ↗
(
        self,
        state: InstanceState[Any],
        dict_: _InstanceDict,
        value: Any,
        initiator: Optional[AttributeEventToken],
        passive: PassiveFlag = PASSIVE_OFF,
    )

Source from the content-addressed store, hash-verified

1926 collection.remove_with_event(value, initiator)
1927
1928 def pop(
1929 self,
1930 state: InstanceState[Any],
1931 dict_: _InstanceDict,
1932 value: Any,
1933 initiator: Optional[AttributeEventToken],
1934 passive: PassiveFlag = PASSIVE_OFF,
1935 ) -> None:
1936 try:
1937 # TODO: better solution here would be to add
1938 # a "popper" role to collections.py to complement
1939 # "remover".
1940 self.remove(state, dict_, value, initiator, passive=passive)
1941 except (ValueError, KeyError, IndexError):
1942 pass
1943
1944 def set(
1945 self,

Callers

nothing calls this directly

Calls 1

removeMethod · 0.95

Tested by

no test coverage detected