propy.str_property¶
-
propy.
str_property
(name)[source]¶ Creates a class property that is restricted to string values. All values set to the property will be converted to strings via str(). If that is not possible, an exception will be raised. To use, place the method within a class’s scope.
Parameters: - name : str
The name of the property to be created.
Examples
>>> class Class(): ... str1 = str_property('str1')