Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.052 X-Spam-Evidence: '*H*': 0.90; '*S*': 0.00; 'integers': 0.09; 'python': 0.11; 'ah,': 0.16; 'attributes.': 0.16; 'composition.': 0.16; 'containers': 0.16; 'dict': 0.16; 'inheritance': 0.16; 'interpreter,': 0.16; 'janssen': 0.16; 'merely': 0.16; 'subject:object': 0.16; 'wrote:': 0.18; 'trying': 0.19; '>>>': 0.22; 'example.': 0.24; 'fraction': 0.24; 'interpret': 0.24; 'lets': 0.24; 'earlier': 0.24; 'header:In-Reply-To:1': 0.27; 'sets': 0.30; 'statement': 0.30; 'message-id:@mail.gmail.com': 0.30; '25,': 0.31; 'object.': 0.31; 'class': 0.32; '(i.e.': 0.33; 'subject:the': 0.34; 'but': 0.35; 'received:google.com': 0.35; 'ordered': 0.36; 'set.': 0.36; 'done': 0.36; 'two': 0.37; 'to:addr :python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'called': 0.40; "you're": 0.61; 'back': 0.62; "you've": 0.63; 'making': 0.63; 'name': 0.63; 'within': 0.65; 'between': 0.67; 'combining': 0.68; 'gotten': 0.74; 'dict,': 0.84; 'dict.': 0.84; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=9xCYIIknPsIA97Gw/b4FfhXFMOow3L9dixC7HXJONFA=; b=fRIX04U7WqcXEswCqdDTIUp3vM5+WYqyJnrlfwDuGRpEiIQhaCvsmuQCUFAjtW4eve pW32AU1igXuTdsciPcxJG21OyQx3ORyZiMcILwB9HjTVJEDEI6EZwz1jv9J4AVmvQV1/ lkRVSXhtU33riWv6O8PNBhPzG+ptA3h+SxxCWK/0+NAPY45OSlL/1JNCTkxKfKp8F6Ga cku1hfuATn4H88lv3Yukol86Y6Sr8WvJetqJdr/H3ObEpmJdt+1mA0F1nWdyEOSAhgsw MSjG++hVh8QFytetSFLSxOtFeQokEybVyv5TuKbNF878RZ2FyRWIlcyEH3kt2mf3bw/O +hxg== X-Received: by 10.68.166.5 with SMTP id zc5mr1543982pbb.16.1372206035266; Tue, 25 Jun 2013 17:20:35 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <15ba0011-bbf1-42f7-b3ea-1c1d4b70e56b@googlegroups.com> <51c66962$0$29999$c3e8da3$5496439d@news.astraweb.com> <20130623133546.GA2308@capricorn> <51c723b4$0$29999$c3e8da3$5496439d@news.astraweb.com> <51C74D6E.6030200@rece.vub.ac.be> From: Ian Kelly Date: Tue, 25 Jun 2013 18:19:55 -0600 Subject: Re: What is the semantics meaning of 'object'? To: Python Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 31 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1372206043 news.xs4all.nl 16011 [2001:888:2000:d::a6]:36799 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:49214 On Tue, Jun 25, 2013 at 5:19 PM, Mark Janssen wrote: >>> Combining integers with sets I can make >>> a Rational class and have infinite-precision arithmetic, for example. >> >> Combining two integers lets you make a Rational. > > Ah, but what is going to group them together? You see you've already > gotten seduced. Python already uses a set to group them together -- > it's called a Dict and it's in every Class object. When you inherit a "set" to make a Rational, you're making the statement (to the interpreter, if nothing else) that a Rational is-a set. When a Python class uses an instance dict to store the numerator and denominator of a Fraction, it's not *inheriting* Fraction from dict, which is good because a Fraction is not a dict. It's merely *using* a dict. It comes back once again to the distinction between inheritance and composition. >> Also, you need an >> ordered set - is the set {5,3} greater or less than the set {2} when >> you interpret them as rationals? > > The ordering (and hence the interpretation) is done WITHIN the Class > (i.e. the SET as I say above). So "set" is just your name for a class? I understood earlier that with integers and sets you were trying to derive your type system from number theory. Now it sounds like you want sets to be containers of attributes. Which is it?