[Python-ideas] Trigonometry in degrees
Michael Selik
mike at selik.org
Sat Jun 9 10:46:34 EDT 2018
On Sat, Jun 9, 2018 at 2:22 AM Adam Bartoš <drekin at gmail.com> wrote:
> The idea was that the functions could handle the PiMultiple instances in a special way and fall back to float only when a special value is not detected. It would be like the proposed dsin functionality, but with a magic class instead of a new set of functions, and without a particular choice of granularity (360 degrees).
>
> But maybe it isn't worth it. Also what about acos(0)? Should it return PiMultiple(1, 2) and confuse people or just 1.5707963267948966 and loose exactness?
>
> That'd be the only module in the standard library with such a specialized
class and behavior. You could argue that pathlib creates a sort of Path
preference with str fallback, but the Path type has a large collection of
methods. In contrast, this PiMultiple type would be only used as an input.
That's very unusual style for Python.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20180609/e352e6ee/attachment.html>
More information about the Python-ideas
mailing list