On 25/08/2016 06:28, Ken Kundert wrote:
> All,
> I propose that support for SI scale factors be added to Python. This would
> be very helpful for any program that heavily uses real numbers, such as those
> involved with scientific and engineering computation. There would be two
> primary
> changes. First, the lexer would be enhanced to take real literals with the
> following forms:
>
> c1 = 1nF (same as: c1 = 1e-9 # F )
> c = 299.79M (same as: c = 299.79e6 )
> f_hy = 1.4204GHz (same as: f_hy = 1.4204e9 # Hz)
>
There is little difference (except that it ask for a syntax modification
which should be heavy weighted)
between this proposition and
c1 = 1*nF (same as: c1 = 1e-9 # F )
c = 299.79*M (same as: c = 299.79e6 )
f_hy = 1.4204*GHz (same as: f_hy = 1.4204e9 # Hz)
with correct definition of the constants in a library.
So a library would be welcome.
_______________________________________________
Python-ideas mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/