def _rereconstituter(name):
    """
    Attriute declaration to preserve mutability on L{URLPath}.

    @param name: a public attribute name
    @type name: native L{str}

    @return: a descriptor which retrieves the private version of the attribute
        on get and calls rerealize on set.
    """
    privateName = nativeString("_") + name
    return property(
        lambda self: getattr(self, privateName),
        lambda self, value: (setattr(self, privateName,
                                     value if isinstance(value, bytes)
                                     else value.encode("charmap")) or
                             self._reconstitute())
    )

    Attriute declaration to preserve mutability on L{URLPath}.

    @param name: a public attribute name
    @type name: native L{str}

    @return: a descriptor which retrieves the private version of the attribute
        on get and calls rerealize on set.
    
stackoverflow/venv/lib/python3.6/site-packages/twisted/python/urlpath.py