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: Paul Rubin Newsgroups: comp.lang.ada Subject: Re: In precision typing we trust Date: Mon, 25 Aug 2025 14:27:55 -0700 Organization: A noiseless patient Spider Message-ID: <87h5xvm6qs.fsf@nightsong.com> 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> <87plcjn5ru.fsf@nightsong.com> <108hek3$3c6u1$1@dont-email.me> <87ldn7mil5.fsf@nightsong.com> <108ift9$3kh0r$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Mon, 25 Aug 2025 21:27:56 +0000 (UTC) Injection-Info: dont-email.me; posting-host="793edc5f42b5b5ea3e3d4c5a0be2fea5"; logging-data="3859780"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/pXBuLCMaW3k1zTGbR0NmC" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Cancel-Lock: sha1:duvPVEHxGEq9llgHA5UBkgO2ajA= sha1:tXcFfPOKttnJR4axVvDy7m0f2mA= Xref: feeder.eternal-september.org comp.lang.ada:66923 List-Id: "Dmitry A. Kazakov" writes: > Call the thing (a set of types closed under derivation) the way you want. Classes in Python aren't sets of types. For example, 3 isn't a type, but in Python 3 it's a member of class 'int'. >>> a = 3 >>> a.__class__ Classes in Python are analogous to types in type theory, but Python isn't lambda calculus. How is that, except for sloppiness "class is ... a class", different from a set of sets of types? Metaclasses in Python are used to control the runtime semantics of newly created classes. E.g. what happens when you create a class instance. It's not really useful to think of Python types as sets. Python isn't that mathematical. You could think of them as sorts, in the sense of multi-sorted logic. Each Python value has a label attached to it (the type tag) that can be inspected at runtime. Those types are also sometimes called latent types.