Skip to content

Instantly share code, notes, and snippets.

View velykanov's full-sized avatar
😶‍🌫️

Mykyta Velykanov velykanov

😶‍🌫️
View GitHub Profile
@velykanov
velykanov / del_key.py
Last active April 8, 2021 12:58
Delete key from nested dictionary
def delete(key, dict_obj):
"""Deletes element from dict_obj accessing by complex key
Args:
key (str): Complex key to your value (separated by dots)
dict_obj (dict): Your dictionary
Raises:
KeyError: if object doesn't contain key