def del_properties(elt, keys=None, ctx=None):
    """Delete elt property.

    :param elt: properties elt to del. Not None methods.
    :param keys: property keys to delete from elt. If empty, delete all
        properties.
    """

    # get the best context
    if ctx is None:
        ctx = find_ctx(elt=elt)

    elt_properties = _ctx_elt_properties(elt=elt, ctx=ctx, create=False)

    # if elt properties exist
    if elt_properties is not None:

        if keys is None:
            keys = list(elt_properties.keys())

        else:
            keys = ensureiterable(keys, iterable=tuple, exclude=str)

        for key in keys:
            if key in elt_properties:
                del elt_properties[key]

        # delete property component if empty
        if not elt_properties:
            # case of dynamic object
            if isinstance(getattr(ctx, '__dict__', None), dict):
                try:
                    if elt in ctx.__dict__[__B3J0F__PROPERTIES__]:
                        del ctx.__dict__[__B3J0F__PROPERTIES__][elt]
                except TypeError:  # if elt is unhashable
                    elt = id(elt)
                    if elt in ctx.__dict__[__B3J0F__PROPERTIES__]:
                        del ctx.__dict__[__B3J0F__PROPERTIES__][elt]
                # if ctx_properties is empty, delete it
                if not ctx.__dict__[__B3J0F__PROPERTIES__]:
                    del ctx.__dict__[__B3J0F__PROPERTIES__]

            # case of static object and hashable
            else:
                if isinstance(ctx, Hashable):
                    cache = __STATIC_ELEMENTS_CACHE__
                else:  # case of static and unhashable object
                    cache = __UNHASHABLE_ELTS_CACHE__
                    ctx = id(ctx)
                    if not isinstance(elt, Hashable):
                        elt = id(elt)

                # in case of static object
                if ctx in cache:
                    del cache[ctx][elt]
                    if not cache[ctx]:
                        del cache[ctx]
def del_properties ( elt , keys = None , ctx = None ) : if ctx is None : ctx = find_ctx ( elt = elt ) elt_properties = _ctx_elt_properties ( elt = elt , ctx = ctx , create = False ) if elt_properties is not None : if keys is None : keys = list ( elt_properties . keys ( ) ) else : keys = ensureiterable ( keys , iterable = tuple , exclude = str ) for key in keys : if key in elt_properties : del elt_properties [ key ] if not elt_properties : if isinstance ( getattr ( ctx , '__dict__' , None ) , dict ) : try : if elt in ctx . __dict__ [ __B3J0F__PROPERTIES__ ] : del ctx . __dict__ [ __B3J0F__PROPERTIES__ ] [ elt ] except TypeError : elt = id ( elt ) if elt in ctx . __dict__ [ __B3J0F__PROPERTIES__ ] : del ctx . __dict__ [ __B3J0F__PROPERTIES__ ] [ elt ] if not ctx . __dict__ [ __B3J0F__PROPERTIES__ ] : del ctx . __dict__ [ __B3J0F__PROPERTIES__ ] else : if isinstance ( ctx , Hashable ) : cache = __STATIC_ELEMENTS_CACHE__ else : cache = __UNHASHABLE_ELTS_CACHE__ ctx = id ( ctx ) if not isinstance ( elt , Hashable ) : elt = id ( elt ) if ctx in cache : del cache [ ctx ] [ elt ] if not cache [ ctx ] : del cache [ ctx ]
Delete elt property.

    :param elt: properties elt to del. Not None methods.
    :param keys: property keys to delete from elt. If empty, delete all
        properties.