remove_dict_keyT_remove_dict_keyRemoveDictKeyRemoveDictKeyremove_dict_key (算子)

名称

remove_dict_keyT_remove_dict_keyRemoveDictKeyRemoveDictKeyremove_dict_key — 从字典中移除键。

签名

remove_dict_key( : : DictHandle, Key : )

Herror T_remove_dict_key(const Htuple DictHandle, const Htuple Key)

void RemoveDictKey(const HTuple& DictHandle, const HTuple& Key)

void HDict::RemoveDictKey(const HTuple& Key) const

void HDict::RemoveDictKey(const HString& Key) const

void HDict::RemoveDictKey(const char* Key) const

void HDict::RemoveDictKey(const wchar_t* Key) const   ( Windows only)

static void HOperatorSet.RemoveDictKey(HTuple dictHandle, HTuple key)

void HDict.RemoveDictKey(HTuple key)

void HDict.RemoveDictKey(string key)

def remove_dict_key(dict_handle: HHandle, key: MaybeSequence[Union[str, int]]) -> None

描述

remove_dict_keyremove_dict_keyRemoveDictKeyRemoveDictKeyRemoveDictKeyremove_dict_key removes the keys specified in KeyKeyKeyKeykeykey from the dictionary passed in DictHandleDictHandleDictHandleDictHandledictHandledict_handle and releases all the (tuple or object) data associated with those keys.

If an error occurs while processing one or more keys (in particular if a key is invalid), the operator attempts to continue removing as many keys as possible before reporting an appropriate failure.

执行信息

此算子修改后续输入参数的状态:

在执行此算子时,若该参数值需在多个线程间使用,则必须对其访问进行同步。

参数

DictHandleDictHandleDictHandleDictHandledictHandledict_handle (输入控制,状态被修改)  dict HDict, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Dictionary handle.

元素数量: DictHandle == 1

KeyKeyKeyKeykeykey (输入控制)  string(-array) HTupleMaybeSequence[Union[str, int]]HTupleHtuple (string / integer) (string / int / long) (HString / Hlong) (char* / Hlong)

Key to remove.

限制: length(Key) > 0

示例(HDevelop)

* Remove all keys
get_dict_param (Dict, 'keys', [], Keys)
remove_dict_key (Dict, Keys)

结果

If all the operator parameters are valid, remove_dict_keyremove_dict_keyRemoveDictKeyRemoveDictKeyRemoveDictKeyremove_dict_key 返回 2 ( H_MSG_TRUE )。否则将抛出异常。

可能的前趋

create_dictcreate_dictCreateDictCreateDictCreateDictcreate_dict

可能的后继

get_dict_paramget_dict_paramGetDictParamGetDictParamGetDictParamget_dict_param

另见

create_dictcreate_dictCreateDictCreateDictCreateDictcreate_dict, set_dict_tupleset_dict_tupleSetDictTupleSetDictTupleSetDictTupleset_dict_tuple, get_dict_tupleget_dict_tupleGetDictTupleGetDictTupleGetDictTupleget_dict_tuple, set_dict_objectset_dict_objectSetDictObjectSetDictObjectSetDictObjectset_dict_object, get_dict_objectget_dict_objectGetDictObjectGetDictObjectGetDictObjectget_dict_object, get_dict_paramget_dict_paramGetDictParamGetDictParamGetDictParamget_dict_param

模块

基础