On 4/04/22 2:42 pm, Ricky Teachey wrote:
height = 5ft + 4.5in

Surely we ought to be able to add these values. But what should the resulting tag be?

One answer might be that the tag only tracks what kind of quantity it
is -- length, mass, time, etc. Internally the number would be
represented in a standard unit for each quantity.

Whether to display it as feet or inches or a combination of both would
then be a matter of formatting. A default could be chosen based on the
magnitude of the number, and if you wanted something else you would have
to specify it, just as with any other formatting decision.

Should we be able to write it like this?

height = 5ft 4.5in

With my "no new syntax" suggestion there would be no question here --
the only way to write it would be

    height = 5 * ft + 4.5 * in

--
Greg


_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/EE6HH7WARD4YIZWGJC4EJN6PMMK3QPWU/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to