From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on ip-172-31-91-241.ec2.internal X-Spam-Level: X-Spam-Status: No, score=0.0 required=3.0 tests=none autolearn=ham autolearn_force=no version=4.0.1 Path: nntp.eternal-september.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Lawrence =?iso-8859-13?q?D=FFOliveiro?= Newsgroups: comp.lang.ada Subject: Re: In precision typing we trust Date: Mon, 25 Aug 2025 21:10:12 -0000 (UTC) Organization: A noiseless patient Spider Message-ID: <108ijfj$3lihe$4@dont-email.me> References: <107uv9g$3019a$1@dont-email.me> <107v1ji$303of$1@dont-email.me> <336fbb5f-a279-ea8e-67fd-f62bb00d6a89@irrt.De> <107vfb9$34cpj$1@dont-email.me> <10855lq$gj8l$1@dont-email.me> <1088h1a$19635$1@dont-email.me> <1089p1i$1ig1d$1@dont-email.me> <108aq2p$1qo9o$1@dont-email.me> <108dh2l$2f5h3$1@dont-email.me> <108ej11$2mbr8$1@dont-email.me> <108g1fv$32gqg$3@dont-email.me> <108h6b7$3a75k$3@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Mon, 25 Aug 2025 21:10:12 +0000 (UTC) Injection-Info: dont-email.me; posting-host="779bbd88069c28ff428306051096dbbf"; logging-data="3852846"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+DDSGEatqPcddqKSh41JfZ" User-Agent: Pan/0.163 (Kryvyi Rih) Cancel-Lock: sha1:7t+Zo75i5qDd/D+tZ8YTZQN+iIM= Xref: feeder.eternal-september.org comp.lang.ada:66921 List-Id: On Mon, 25 Aug 2025 10:19:50 +0200, Dmitry A. Kazakov wrote: > On 2025-08-24 23:50, Lawrence D’Oliveiro wrote: >> >> Python not only has inheritance, it has full multiple inheritance >> with C3 linearization. > > No members are inherited. from enum import \ Enum class MYENUM(int, Enum) : VAL1 = 1 VAL3 = 3 #end MYENUM print(isinstance(MYENUM.VAL1, int), isinstance(MYENUM.VAL1, MYENUM)) True True print(MYENUM.VAL1 + 1) 2 print(MYENUM(3)) MYENUM.VAL3 print(MYENUM(2)) --------------------------------------------------------------------------- ValueError Traceback (most recent call last) [detailed traceback omitted] ValueError: 2 is not a valid MYENUM > Not to say that nothing is checked etc. Expecting that from an untyped > language would be silly anyway. Python is strongly typed. > But in OO it is incorrect to inherit covariant methods with arguments in > the out or in-out mode ... That’s OK, because Python only has “in” mode. >> It also has metaclasses. Because classes, like functions, are >> first-class objects. > > A useless thing in an untyped language ... Except Python is strongly typed. > ... and in general one should first question what could be the > purpose of a set of a set of types? It does away with the need for generics and a separate compile-time language for working with them. Instead, you use the same run-time language as you would for everything else. Also, this .