On Tuesday, May 7, 2002 at 9:15:50 AM UTC+12, Fernando Pérez wrote:
> Plus, if you really need those conversions, it's less typing and more 
> efficient (no function call) to simply use a multiplicative constant...

This I have found to be the best idea. In Qahirah 
<https://github.com/ldo/qahirah> I provided “deg” and “circle” constants, used 
like this:

    ldo@hypatia:~> python3 -ic "import math, qahirah as qah"
    >>> math.sin(45 * qah.deg)
    0.7071067811865475
    >>> math.atan(1) / qah.deg
    45.0
    >>> math.cos(qah.circle / 4)
    6.123233995736766e-17

I think these provide greater flexibility than having to have explicit 
conversion functions.
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to