def typed_property(name, expected_type):
    """Common function used to creating arguments with forced type

    :param name: name of attribute
    :param expected_type: expected type of attribute value
    :return: property attribute
    """
    private_name = '_' + name

    @property
    def prop(self):
        return getattr(self, private_name)

    @prop.setter
    def prop(self, value):
        if not isinstance(value, expected_type):
            raise TypeError('Expected {}'.format(expected_type))
        setattr(self, private_name, value)

    return prop