Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!selfless.tophat.at!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'else:': 0.03; 'tue': 0.05; 'python': 0.08; '0),': 0.09; 'content-type:multipart/signed': 0.09; 'either.': 0.09; 'filename:fname piece:signature': 0.09; 'foo': 0.09; 'header:In-reply-to:1': 0.09; 'structure.': 0.09; 'subject:language': 0.09; 'there?': 0.09; 'defined': 0.14; '"top': 0.16; '(100,': 0.16; '1),': 0.16; 'abraham': 0.16; 'content- type:application/pgp-signature': 0.16; 'filename:fname piece:asc': 0.16; 'filename:fname:signature.asc': 0.16; 'from:addr:kb1pkl': 0.16; 'from:name:corey richardson': 0.16; 'richardson': 0.16; 'structure,': 0.16; 'sure,': 0.16; 'argument': 0.16; '>>>': 0.16; 'def': 0.16; 'exists.': 0.19; 'occurred': 0.19; 'to:name:python- list': 0.19; 'language': 0.20; 'is?': 0.22; 'modify': 0.22; "doesn't": 0.22; 'structure': 0.23; 'function': 0.26; 'pass': 0.28; 'sort': 0.28; 'objects': 0.28; 'lists': 0.29; '-0400': 0.30; 'controlled': 0.30; 'key,': 0.30; 'looks': 0.30; 'certainly': 0.32; 'does': 0.32; 'comment': 0.33; "what's": 0.33; 'to:addr :python-list': 0.34; 'header:User-Agent:1': 0.34; 'there': 0.34; 'all.': 0.35; 'advocate': 0.35; 'probably': 0.35; 'skip:" 10': 0.36; 'but': 0.37; 'received:76': 0.38; 'user': 0.38; 'subject:: ': 0.38; 'something': 0.38; 'run': 0.39; 'data': 0.39; 'to:addr:python.org': 0.39; 'determine': 0.40; 'methods': 0.40; 'skip:r 20': 0.40; 'received:205': 0.61; 'header:Message-Id:1': 0.61; 'received:205.188': 0.61; 'below': 0.62; 'received:172.29': 0.64; 'received:r1000.mx.aol.com': 0.64; 'subject:!': 0.67; 'from:addr:aim.com': 0.67; 'freedom': 0.68; 'become': 0.72; 'subject:The': 0.73; '"user': 0.84; '2011:': 0.84; 'structures.': 0.84; 'subject:come': 0.91 Subject: Re: The end to all language wars and the great unity API to come! From: Corey Richardson To: python-list In-reply-to: <22a13bda-899d-4765-a03c-f8a36efaf905@34g2000yqr.googlegroups.com> References: <1bf8cf87-b173-470a-a05e-a65616c988a0@d22g2000yqn.googlegroups.com> <41f31477-48ee-4a8a-ab2d-87073a918996@r18g2000vbs.googlegroups.com> <6dd92755-c8e9-47ef-aa08-ffffbc3d1893@5g2000yqb.googlegroups.com> <97a7q6FtqcU1@mid.individual.net> <6a9373cd-4b27-447a-8be4-db74effde338@g16g2000yqg.googlegroups.com> <97d8spFg2nU1@mid.individual.net> <22a13bda-899d-4765-a03c-f8a36efaf905@34g2000yqr.googlegroups.com> Date: Tue, 05 Jul 2011 12:04:32 -0400 User-Agent: Sup/0.12.1 Content-Transfer-Encoding: 8bit MIME-Version: 1.0 Content-Type: multipart/signed; micalg="pgp-sha256"; boundary="=-1309881876-400396-3182-7388-1-="; protocol="application/pgp-signature" x-aol-global-disposition: G X-AOL-VSS-INFO: 5400.1158/72066 X-AOL-VSS-CODE: scan_error X-AOL-SCOLL-SCORE: 0:2:438589792:93952408 X-AOL-SCOLL-URL_COUNT: 0 x-aol-sid: 3039ac1d33c34e13362d60c6 X-AOL-IP: 76.119.157.207 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 95 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1309882223 news.xs4all.nl 21845 [2001:888:2000:d::a6]:51089 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:8843 --=-1309881876-400396-3182-7388-1-= Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: quoted-printable Excerpts from rantingrick's message of Tue Jul 05 07:42:39 -0400 2011: > > I was thinking more about this comment and it occurred to me that > Python does have user controlled data structures. Just because there > is no "top level syntax" like ruby does not mean these do not exists. > You only have to look below the surface. Take the sort methods of > lists for example... > = > >>> lst =3D [ > (100, 0), > (25, 2), > (10,1), > ] > >>> lst > [(100, 0), (25, 2), (10, 1)] > >>> lst.sort() > >>> lst > [(10, 1), (25, 2), (100, 0)] > >>> lst.sort(lambda x,y: cmp(x[1], y[1])) > >>> lst > [(100, 0), (10, 1), (25, 2)] > = > ...that looks like a "user defined control" structure to me. So how > can an anti-feature become part of the language proper? (devils > advocate here) :) > = How is giving the sort method a function by which to determine the relati= ve value of objects a control structure? Do you know what a control structur= e is? It's something that you use to modify control flow: if foo <=3D bar: foo +=3D 1 else: bar +=3D 1 That's a control structurem the "if-else". I don't know what Ruby calls a= = control structure, but that's what it is. for and while are in there too.= When you run lst.sort(lambda x, y: cmp(x[1], y[1])), what happens? We'll call that argument srt, here's a sample (naive) implementation: def sort(key): lst =3D self.internal_list for n in range(len(self.internal_list) - 1): for i in range(len(self.internal_list) - 1): if srt(lst[i], lst[i+1]) < 0: lst[i], lst[i+1] =3D lst[i+1], lst[i] Untested, probably doesn't work either. See what's in there? An if. Nothi= ng "user-defined" at all. Sure, WHAT the if does is user-controlled with the= key, but that doesn't make that particular if a new control structure, an= d it certainly doesn't make the key a control structure. You can pass a key= to a sort even in C and that certainly doesn't have user defined control structures. -- = Corey Richardson "Those who deny freedom to others, deserve it not for themselves" -- Abraham Lincoln --=-1309881876-400396-3182-7388-1-= Content-Disposition: attachment; filename="signature.asc" Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (GNU/Linux) iQEcBAEBCAAGBQJOEzYUAAoJEAFAbo/KNFvpoecH+wT/2q3RxbQanTEipm+K+SHW NtlmmjgqUahG0GhR23IjpRswEQDtUNn0OAR0kcYQlw8EtsT8OWYDPc6HWm6YS7jS CzeGu58sMOG7BolmardcNAH1uEdoas5xa1cXFGnYaUjm8ao3zWsioloz2njZQLbW cxLgu8uK9nVa2KfNskkn8COqKLhcHBCVlBn6+EpJTo6ltYH7y9oqpb+gUfpTlfFn z23R+M9A7WBHIkhox4Qgwl4egKgr90FyphLGnV3xzhZvz4TEaGj6bI/9e2DTpk08 5pmn2RTG1giiQakf6HGTXDglOtgmpBd0WqYaYwB6vjgz1RI5X+LTtWDryYZKNLA= =BbRV -----END PGP SIGNATURE----- --=-1309881876-400396-3182-7388-1-=--