Re: Need Assistance -- Network Programming

Liste des GroupesRevenir à col advocacy 
Sujet : Re: Need Assistance -- Network Programming
De : ldo (at) *nospam* nz.invalid (Lawrence D'Oliveiro)
Groupes : comp.os.linux.advocacy
Date : 27. Jun 2024, 10:01:28
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v5j68n$2ks7o$7@dont-email.me>
References : 1 2 3 4 5 6 7 8 9
User-Agent : Pan/0.158 (Avdiivka; )
On 26 Jun 2024 23:58:30 GMT, rbowman wrote:

Similarly while Python has math.degrees() and math.radians() ...

I’ve long felt those conversion functions are an unnecessarily roundabout
way of doing things. After all, you need two for every angle unit,
assuming you stick with radians as the common basis among all of them.
Otherwise you need even more.

Better to have a single conversion factor for each unit, e.g.

    class ANGLE_UNITS(float, enum.Enum) :
        "standard values for Context.angle_units."
        RADIANS = 1.0
        DEGREES = math.pi / 180
        GRADIANS = math.pi / 200
        CIRCLE = 2 * math.pi
    #end ANGLE_UNITS

so you multiply by the factor to convert the units to radians, and divide
by the same factor to convert radians to those units.

Then all your trig functions can operate exclusively in radians:

    units = ANGLE_UNITS.DEGREES
    θ = float(input("Angle in degrees? "))
    x = math.sin(θ * units)
    print("Angle: ", math.asin(x) / units, "°")

And yes, Python does full multiple inheritance. And yes, you can subclass
from builtin types like float as well. And further yes, enums are not a
built-in language feature, they are provided in a library module that is
written in pure Python.

Date Sujet#  Auteur
19 Jun 24 * Need Assistance -- Network Programming35Lester Thorpe
19 Jun 24 +- Re: Need Assistance -- Network Programming1rbowman
19 Jun 24 +* Re: Need Assistance -- Network Programming20Lester Thorpe
19 Jun 24 i`* Re: Need Assistance -- Network Programming19Tyrone
19 Jun 24 i `* Re: Need Assistance -- Network Programming18vallor
19 Jun 24 i  `* Re: Need Assistance -- Network Programming17Farley Flud
20 Jun 24 i   `* Re: Need Assistance -- Network Programming16vallor
20 Jun 24 i    +* Re: Need Assistance -- Network Programming3rbowman
20 Jun 24 i    i+- Re: Need Assistance -- Network Programming1Farley Flud
20 Jun 24 i    i`- Re: Need Assistance -- Network Programming1rbowman
20 Jun 24 i    +* Re: Need Assistance -- Network Programming3vallor
20 Jun 24 i    i+- Re: Need Assistance -- Network Programming1%
21 Jun 24 i    i`- Re: Need Assistance -- Network Programming1rbowman
21 Jun 24 i    +* Re: Need Assistance -- Network Programming2Lester Thorpe
21 Jun 24 i    i`- Re: Need Assistance -- Network Programming1vallor
26 Jun 24 i    `* Re: Need Assistance -- Network Programming7Lawrence D'Oliveiro
26 Jun 24 i     +- Re: Need Assistance -- Network Programming1vallor
26 Jun 24 i     `* Re: Need Assistance -- Network Programming5DFS
27 Jun 24 i      `* Re: Need Assistance -- Network Programming4rbowman
27 Jun 24 i       +* Re: Need Assistance -- Network Programming2candycanearter07
27 Jun 24 i       i`- Re: Need Assistance -- Network Programming1rbowman
27 Jun 24 i       `- Re: Need Assistance -- Network Programming1Lawrence D'Oliveiro
19 Jun 24 +- Re: Need Assistance -- Network Programming1vallor
20 Jun 24 +* Re: Need Assistance -- Network Programming11candycanearter07
20 Jun 24 i`* Re: Need Assistance -- Network Programming10Lester Thorpe
21 Jun 24 i `* Re: Need Assistance -- Network Programming9candycanearter07
22 Jun 24 i  `* Re: Need Assistance -- Network Programming8Stéphane CARPENTIER
23 Jun 24 i   +* Re: Need Assistance -- Network Programming2candycanearter07
23 Jun 24 i   i`- Re: Need Assistance -- Network Programming1Stéphane CARPENTIER
26 Jun 24 i   `* Re: Need Assistance -- Network Programming5Lawrence D'Oliveiro
26 Jun 24 i    `* Re: Need Assistance -- Network Programming4candycanearter07
27 Jun 24 i     `* Re: Need Assistance -- Network Programming3Lawrence D'Oliveiro
27 Jun 24 i      `* Re: Need Assistance -- Network Programming2candycanearter07
27 Jun 24 i       `- Re: Need Assistance -- Network Programming1Lawrence D'Oliveiro
26 Jun 24 `- Re: Need Assistance -- Network Programming1Lawrence D'Oliveiro

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal