Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Ben Finney Newsgroups: comp.lang.python Subject: Distinction between =?utf-8?B?4oCcY2xhc3PigJ0=?= and =?utf-8?B?4oCcdHlwZeKAnQ==?= Date: Fri, 13 May 2016 15:07:04 +1000 Lines: 35 Message-ID: References: <85eg96eebr.fsf@benfinney.id.au> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: news.uni-berlin.de W73NC+xVwsTv90RLaGKdwgXwENGewKCsl/12rwzHUldg== Cancel-Lock: sha1:QCZ0+bQTxKYcqvW+8MWNdsd1zPI= Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'guido': 0.05; 'tries': 0.05; 'url:pipermail': 0.05; 'important,': 0.07; 'type,': 0.07; 'optional': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.10; 'around!': 0.16; 'distinction': 0.16; 'instantiate': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'subject:between': 0.16; 'unions': 0.16; 'unwise': 0.16; 'all,': 0.20; '(the': 0.22; 'variables.': 0.22; '(you': 0.23; "python's": 0.23; 'header:User-Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'moved': 0.27; 'expose': 0.29; 'pep': 0.29; 'classes': 0.30; 'class.': 0.30; 'e.g.': 0.30; 'class': 0.33; 'url:python': 0.33; 'clear': 0.35; 'but': 0.36; 'url:org': 0.36; 'to:addr:python- list': 0.36; 'received:org': 0.37; 'things': 0.38; 'why': 0.39; 'url:mail': 0.40; 'to:addr:python.org': 0.40; 'ever': 0.60; 'care': 0.60; 'more': 0.63; 'to,': 0.63; 'between': 0.65; 'inherit': 0.66; 'subjectcharset:utf-8': 0.71; 'truth': 0.79; '_o__)': 0.84; 'brain,': 0.84; 'received:125': 0.84 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: jigong.madmonks.org X-Public-Key-ID: 0xAC128405 X-Public-Key-Fingerprint: 517C F14B B2F3 98B0 CB35 4855 B8B2 4C06 AC12 8405 X-Public-Key-URL: http://www.benfinney.id.au/contact/bfinney-pubkey.asc X-Post-From: Ben Finney User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <85eg96eebr.fsf@benfinney.id.au> Xref: csiph.com comp.lang.python:108578 Howdy all, Ever since Python's much-celebrated Grand Unification of classes and types, I have used those terms interchangeably: every class is a type, and every type is a class. That may be an unwise conflation. With the recent rise of optional type annotation in Python 3, more people are speaking about the important distinction between a class and a type. This recent message from GvR, discussing a relevant PEP, advocates keeping them separate: PEP 484 […] tries to make a clear terminological between classes (the things you have at runtime) and types (the things that type checkers care about). There's a big overlap because most classes are also types -- but not the other way around! E.g. Any is a type but not a class (you can neither inherit from Any nor instantiate it), and the same is true for unions and type variables. […] As a Bear of Little Brain, this leaves me clueless. What is the distinction Guido alludes to, and how are Python classes not also types? And why is this distinction important, and who moved my cheesecake? -- \ “It is the responsibility of intellectuals to tell the truth | `\ and to expose lies.” —Noam Chomsky, 1967-02-23 | _o__) | Ben Finney