Create a property setter method for the attribute.

    Args:
        _: The name of the attribute to set. Unused.
        private_attr: The name of the attribute that will store any data
            related to the attribute.
        type_: The annotated type defining what values can be stored in the
            attribute.

    Returns:
        A method that takes self and a value and stores that value on self
        in the private attribute iff the value is an instance of type_.

def _strict_object_meta_fset(_, private_attr, type_):
    # type: (str, str, Type[_T]) -> Callable[[_T], None]
    """Create a property setter method for the attribute.

    Args:
        _: The name of the attribute to set. Unused.
        private_attr: The name of the attribute that will store any data
            related to the attribute.
        type_: The annotated type defining what values can be stored in the
            attribute.

    Returns:
        A method that takes self and a value and stores that value on self
        in the private attribute iff the value is an instance of type_.
    """

    def _fset(self, value):  # type: Any
        # type: (...) -> None
        """Set the value on self iff the value is an instance of type_.

        Args:
            value: The value to set.

        Raises:
            TypeError: Raised when the value is not an instance of type_.
        """
        rtype = type_
        if isinstance(type_, TypeVar):
            type_map = dict(
                zip(self.__parameters__, self.__orig_class__.__args__)
            )
            rtype = type_map[type_]
        if not is_instance(value, rtype):
            raise TypeError(
                "Cannot assign type of {} to attribute of type {}.".format(
                    _get_type_name(type(value)), _get_type_name(rtype)
                )
            )
        vars(self)[private_attr] = value

    return _fset