On 4/13/23 7:25 PM, avi.e.gr...@gmail.com wrote:
s there any concept in Python of storing information in some way, such as
text, and implementing various ideas or interfaces so that you can query if
the contents are willing and able to be viewed in one of many other ways?
There is nothing that I know of built into Python that does this.
There is no reason you can't write your own class to implement this.
Something that by "default" looks like a string, but in some contexts
(operated on by certain types) sees if its string could be treated as a
value of some other type, and if so, converts its value to that type and
does the operation.
--
Richard Damon
--
https://mail.python.org/mailman/listinfo/python-list