Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #54022
| Path | csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <python-python-list@m.gmane.org> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.000 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; '(at': 0.04; 'guido': 0.05; 'sufficient': 0.05; '(of': 0.07; 'made.': 0.07; 'excluding': 0.09; 'literal': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'rejected': 0.09; 'subject:design': 0.09; '{},': 0.09; 'python': 0.11; 'jan': 0.12; 'changes': 0.15; "'__doc__',": 0.16; 'c():': 0.16; 'dict': 0.16; 'did,': 0.16; 'janssen': 0.16; 'metaclass': 0.16; 'once.': 0.16; 'pairs': 0.16; 'really?': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'subclasses': 0.16; 'subject:Language': 0.16; 'substitution': 0.16; 'weird': 0.16; 'wrote:': 0.18; '>>>': 0.22; 'appears': 0.22; 'saying': 0.22; 'header:User-Agent:1': 0.23; 'sort': 0.25; 'class.': 0.26; 'right.': 0.26; 'pass': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'tried': 0.27; 'sets': 0.30; "skip:' 10": 0.31; 'class': 0.32; 'another': 0.32; 'community': 0.33; 'everyone': 0.33; 'but': 0.35; 'there': 0.35; 'set.': 0.36; 'useful': 0.36; 'should': 0.36; 'too': 0.37; 'two': 0.37; 'skip:[ 10': 0.38; 'to:addr:python- list': 0.38; 'pm,': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'even': 0.60; 'received:173': 0.61; 'you.': 0.62; 'discuss': 0.62; 'name': 0.63; 'such': 0.63; 'more': 0.64; 'different': 0.65; 'bottom': 0.67; 'actually,': 0.84; 'adoption': 0.84; 'dict.': 0.84; 'imagination': 0.84; 'indirect': 0.84; 'pain': 0.84; 'received:fios.verizon.net': 0.84; 'from.': 0.93; 'inheritance,': 0.93 |
| X-Injected-Via-Gmane | http://gmane.org/ |
| To | python-list@python.org |
| From | Terry Reedy <tjreedy@udel.edu> |
| Subject | Re: Language design |
| Date | Wed, 11 Sep 2013 21:40:39 -0400 |
| References | <522eb795$0$29999$c3e8da3$5496439d@news.astraweb.com> <mailman.270.1378935062.5461.python-list@python.org> <5230ff66$0$29988$c3e8da3$5496439d@news.astraweb.com> <CAMjeLr-CgrnT4D45ByOHbuKVfkPA6n5CAVw0RxaXtVRRcy7ETw@mail.gmail.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-Gmane-NNTP-Posting-Host | pool-173-75-251-66.phlapa.fios.verizon.net |
| User-Agent | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 |
| In-Reply-To | <CAMjeLr-CgrnT4D45ByOHbuKVfkPA6n5CAVw0RxaXtVRRcy7ETw@mail.gmail.com> |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.290.1378950058.5461.python-list@python.org> (permalink) |
| Lines | 62 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1378950058 news.xs4all.nl 15863 [2001:888:2000:d::a6]:37774 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:54022 |
Show key headers only | View raw
On 9/11/2013 8:49 PM, Mark Janssen wrote:
>>> 1) It tried to make Object the parent of every class.
>>
>> Tried, and succeeded.
>
> Really? Are you saying you (and the community at-large) always derive
> from Object as your base class?
The name is 'object', and yes, everyone does it because it is automatic.
(I am including indirect inheritance, and excluding weird metaclass games.)
>>> class C(): pass
>>> dir(C)
['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__',
'__format__', '__ge__', '__getattribute__', '__gt__', '__hash__',
'__init__', '__le__', '__lt__', '__module__', '__ne__', '__new__',
'__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__',
'__str__', '__subclasshook__', '__weakref__']
Just *where* do you think all those methods come from.
>>> C.__bases__
(<class 'object'>,)
> But wait is it the "base" (at the bottom of the hierarchy) or is it
> the "parent" at the top?
This sort of quibbling should be beneath you.
> A dict is-a set of {key:object, key:object} pairs bound together with
> a colon ":".
Yes... but there is a very important additional condition: each key
appears only once.
Humans are primates, but that is not a sufficient characterization.
> By inheriting from sets you get a lot of useful
> functionality for free.
Actually, you get a lot of un-useful functionality for free. Because of
the extra condition, the rule for adding a key:object pair to a dict is
different from the rule for adding a key:object pair to a set of such
pairs. The set-union of two dicts is not necessarily a dict. To put is
another way, dicts as set subclasses would violate the Liskov
Substitution Principle.
'Homogenous' sets (of strings, numbers) would be proper subclasses of set.
> Right. The dict literal should be {:}
and the set literal 'should' be {}, and would be if Python were
redesigned from scratch. Is your imagination so stunted that you
actually think we did not discuss that when designing Python 3?
We did, but Guido rejected switching because he thought it would cause
too much pain and discourage adoption of Python 3 even more than the
other code-breaking changes that were made.
--
Terry Jan Reedy
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Language design Steven D'Aprano <steve@pearwood.info> - 2013-09-10 06:09 +0000
Re: Language design diverman <pavel@schon.cz> - 2013-09-09 23:59 -0700
Re: Language design Ben Finney <ben+python@benfinney.id.au> - 2013-09-10 17:07 +1000
Re: Language design Nobody <nobody@nowhere.com> - 2013-09-11 01:03 +0100
Re: Language design Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-09-11 00:53 +0000
Re: Language design Nobody <nobody@nowhere.com> - 2013-09-12 18:23 +0100
Re: Language design Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-09-10 09:58 +0200
Re: Language design Chris Angelico <rosuav@gmail.com> - 2013-09-10 20:20 +1000
Re: Language design Chris Rebert <clp2@rebertia.com> - 2013-09-10 18:46 -0700
Re: Language design Chris Angelico <rosuav@gmail.com> - 2013-09-11 14:21 +1000
Re: Language design Burak Arslan <burak.arslan@arskom.com.tr> - 2013-09-11 13:38 +0300
Re: Language design Neil Cerutti <neilc@norwich.edu> - 2013-09-11 14:32 +0000
Re: Language design Chris Angelico <rosuav@gmail.com> - 2013-09-12 00:46 +1000
Re: Language design Wayne Werner <wayne@waynewerner.com> - 2013-09-11 06:42 -0500
Re: Language design Dave Angel <davea@davea.name> - 2013-09-11 12:05 +0000
Re: Language design Ethan Furman <ethan@stoneleaf.us> - 2013-09-11 07:52 -0700
Re: Language design Burak Arslan <burak.arslan@arskom.com.tr> - 2013-09-11 18:41 +0300
Re: Language design Markus Rother <python@markusrother.de> - 2013-09-11 22:41 +0200
Re: Language design Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-09-11 23:40 +0000
Re: Language design Mark Janssen <dreamingforward@gmail.com> - 2013-09-11 14:22 -0700
Re: Language design Mark Janssen <dreamingforward@gmail.com> - 2013-09-11 14:30 -0700
Re: Language design Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-09-11 23:40 +0000
Re: Language design Mark Janssen <dreamingforward@gmail.com> - 2013-09-11 17:49 -0700
Re: Language design Steven D'Aprano <steve@pearwood.info> - 2013-09-12 05:33 +0000
Re: Language design Mark Janssen <dreamingforward@gmail.com> - 2013-09-12 20:23 -0700
Re: Language design Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-09-13 05:08 +0000
Re: Language design Chris Angelico <rosuav@gmail.com> - 2013-09-13 17:39 +1000
Re: Language design Mark Janssen <dreamingforward@gmail.com> - 2013-09-14 19:37 -0700
Re: Language design Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-09-15 09:57 +0200
Re: Language design Terry Reedy <tjreedy@udel.edu> - 2013-09-11 21:40 -0400
Re: Language design Chris Angelico <rosuav@gmail.com> - 2013-09-12 11:41 +1000
Re: Language design Ethan Furman <ethan@stoneleaf.us> - 2013-09-11 14:15 -0700
RE: Language design "Prasad, Ramit" <ramit.prasad@jpmorgan.com.dmarc.invalid> - 2013-09-11 21:56 +0000
Re: Language design Ben Finney <ben+python@benfinney.id.au> - 2013-09-12 09:16 +1000
Please omit false legalese footers (was: Language design) Ben Finney <ben+python@benfinney.id.au> - 2013-09-12 09:22 +1000
Re: Please omit false legalese footers (was: Language design) Grant Edwards <invalid@invalid.invalid> - 2013-09-12 20:12 +0000
Re: Language design Chris Angelico <rosuav@gmail.com> - 2013-09-12 09:27 +1000
Re: Language design Ben Finney <ben+python@benfinney.id.au> - 2013-09-12 09:19 +1000
Re: Language design Terry Reedy <tjreedy@udel.edu> - 2013-09-11 19:51 -0400
Re: Language design Mark Janssen <dreamingforward@gmail.com> - 2013-09-11 17:25 -0700
Re: Language design Chris Angelico <rosuav@gmail.com> - 2013-09-12 10:31 +1000
Re: Language design Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-09-12 02:33 +0000
Re: Language design Roy Smith <roy@panix.com> - 2013-09-11 22:43 -0400
Re: Language design Chris Angelico <rosuav@gmail.com> - 2013-09-12 12:58 +1000
Re: Language design Steven D'Aprano <steve@pearwood.info> - 2013-09-12 05:08 +0000
Re: Language design Mark Janssen <dreamingforward@gmail.com> - 2013-09-11 17:34 -0700
Re: Language design Mark Janssen <dreamingforward@gmail.com> - 2013-09-11 17:37 -0700
Re: Language design Chris Angelico <rosuav@gmail.com> - 2013-09-12 10:40 +1000
Re: Language design Benjamin Kaplan <benjamin.kaplan@case.edu> - 2013-09-11 17:54 -0700
Re: Language design Ben Finney <ben+python@benfinney.id.au> - 2013-09-12 10:57 +1000
Re: Language design Joshua Landau <joshua@landau.ws> - 2013-09-12 05:17 +0100
Re: Please omit false legalese footers (was: Language design) Skip Montanaro <skip@pobox.com> - 2013-09-12 04:27 -0500
Re: Please omit false legalese footers (was: Language design) Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2013-09-12 10:44 +0100
Re: Language design Markus Rother <python@markusrother.de> - 2013-09-12 19:51 +0200
Re: Language design Neil Cerutti <neilc@norwich.edu> - 2013-09-12 18:06 +0000
Re: Language design Markus Rother <python@markusrother.de> - 2013-09-12 20:13 +0200
Re: Language design Markus Rother <python@markusrother.de> - 2013-09-12 20:24 +0200
Re: Language design Neil Cerutti <neilc@norwich.edu> - 2013-09-12 19:18 +0000
Re: Language design Ethan Furman <ethan@stoneleaf.us> - 2013-09-12 11:05 -0700
Re: Language design Ned Batchelder <ned@nedbatchelder.com> - 2013-09-12 14:37 -0400
Re: Language design Terry Reedy <tjreedy@udel.edu> - 2013-09-12 14:46 -0400
Re: Language design Chris Angelico <rosuav@gmail.com> - 2013-09-13 07:53 +1000
Re: Language design Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-09-13 09:04 +0200
Re: Language design Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-09-13 10:13 +0000
Re: Language design Chris Angelico <rosuav@gmail.com> - 2013-09-13 21:16 +1000
Re: Language design Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-09-13 13:28 +0200
Re: Language design Terry Reedy <tjreedy@udel.edu> - 2013-09-13 15:32 -0400
Re: Language design Chris Angelico <rosuav@gmail.com> - 2013-09-14 09:57 +1000
Re: Language design Neil Cerutti <neilc@norwich.edu> - 2013-09-18 14:57 +0000
Re: Language design Chris Angelico <rosuav@gmail.com> - 2013-09-19 01:02 +1000
Re: Language design Neil Cerutti <neilc@norwich.edu> - 2013-09-18 15:08 +0000
Re: Language design Chris Angelico <rosuav@gmail.com> - 2013-09-19 01:12 +1000
Re: Language design William Ray Wing <wrw@mac.com> - 2013-09-18 12:58 -0400
Re: Language design wxjmfauth@gmail.com - 2013-09-18 10:45 -0700
Re: Language design Neil Cerutti <neilc@norwich.edu> - 2013-09-18 17:55 +0000
Re: Language design Mark Janssen <dreamingforward@gmail.com> - 2013-09-13 17:28 -0700
Re: Language design Vito De Tullio <vito.detullio@gmail.com> - 2013-09-14 07:25 +0200
csiph-web