On 6/08/20 6:42 am, David Mertz wrote:
@unit("meter") a = 3 # a = unit("meter")("a", 3)
@unit("foot") b = 4 # b = unit("foot")("b", 4)
This still doesn't explain why the decorator syntax would be
significantly better than just calling the function directly.
meters = unit("meter")
feet = unit("foot")
a = meters(3)
b = feet(4)
Seems just as readable to me.
--
Greg
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/GLOEEL3LLGMHQP5UN3RLW55LJOAG2F4Y/
Code of Conduct: http://python.org/psf/codeofconduct/