Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'argument': 0.04; 'essentially': 0.04; 'subject:Python': 0.05; 'assign': 0.07; 'python': 0.09; '"can\'t': 0.09; 'integers': 0.09; 'objects.': 0.09; 'cc:addr:python-list': 0.10; 'gui': 0.11; 'passing': 0.15; 'value.': 0.15; '*can*': 0.16; 'buttons,': 0.16; 'declaration': 0.16; 'driscoll': 0.16; 'filename:fname piece:signature': 0.16; 'subject:Objects': 0.16; 'wrote:': 0.17; 'certainly': 0.17; 'variables': 0.17; 'saying': 0.18; 'comfortable': 0.20; 'fairly': 0.21; 'java': 0.21; 'diverse': 0.22; 'object.': 0.22; 'void': 0.22; 'cc:2**0': 0.23; 'thus': 0.24; 'cc:no real name:2**0': 0.24; 'pass': 0.25; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'second,': 0.29; 'class': 0.29; "i'm": 0.29; '(and': 0.32; 'certain': 0.33; 'turns': 0.33; 'code:': 0.33; "can't": 0.34; 'whatever': 0.35; 'especially': 0.35; 'pm,': 0.35; 'there': 0.35; 'but': 0.36; 'method': 0.36; 'useful': 0.36; 'does': 0.37; 'subject:: ': 0.38; 'fact': 0.38; 'object': 0.38; 'things': 0.38; 'takes': 0.39; 'you.': 0.61; 'warm': 0.62; 'more': 0.63; "'object'": 0.84; 'to:addr:yahoo.co.uk': 0.84; 'fyi': 0.91; 'kat': 0.91 Date: Wed, 22 Aug 2012 16:31:08 -0500 From: Evan Driscoll User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.6esrpre) Gecko/20120714 Thunderbird/10.0.6 MIME-Version: 1.0 To: lipska the kat Subject: Re: Re: Objects in Python References: <18409992-1e28-4721-8e64-60c69668da4e@googlegroups.com> In-Reply-To: X-Enigmail-Version: 1.4 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigB4E594856726E75E46D936E0" Cc: python-list@python.org 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: 59 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1345671073 news.xs4all.nl 6990 [2001:888:2000:d::a6]:38617 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:27686 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigB4E594856726E75E46D936E0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 08/22/2012 02:45 PM, lipska the kat wrote: > On 22/08/12 20:03, Evan Driscoll wrote: >> Second, this concept isn't *so* unfamiliar to you. If I give you the >> following Java code: >> >> void foo(Object o) { ... } >> > looking at this method declaration I can see that the method takes an > argument of type Object (and just FYI class Object is not abstract and > you can do Object o =3D new Object()) and does not return a value. > I know that for the lifetime of this JVM, whatever o turns out to be it= > will always be an Object. I can't assign a primitive to o as ints chars= > floats etc are certainly not Objects. There are certain invariants that= > give me a warm and comfortable feeling inside. I'm not saying it's nothing, but "can't assign a primitive" isn't much of an invariant in the broad scheme of things when you can pass items as diverse as lists, GUI buttons, files, etc. I would say it's more like if you see 'int x' then *that* imposes a pretty big invariant, but passing 'Object' imposes almost nothing. This is especially true considering the fact that you actually *can* say 'foo(4)' and Java will go and autobox the 4 into Integer(4) for you. (BTW, this analogy suggests a way that's actually fairly useful for how to look at Python coming from the Java perspective: Python just lacks primitive types and things like integers are always boxed. Thus *all* Python variables are essentially references.) Evan --------------enigB4E594856726E75E46D936E0 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEVAwUBUDVPnAOzoR8eZTzgAQK78Qf+LbGlDezuFJ/LwsmIlSuRi3ZwfqY8I/9j wA3of5N8rmA3ETcJh+eNGuMLQ536SzDi3vlwSgMcKE1h97KmfV3F5PLkW9/v6OPC dRqz4+8XsQjiCMm4PGMgbnxi1A0juYro9wNC4ltCs0cTNCK9wQyN54bDlS/RMMPn fcSLzeK/rUsCUsgemVE9Qdkx50V4kguicAKt9bUS7jmzGEfVERd+3lffqn6fjdm0 W4rbxw1mUEnHYNDblJzY1uT86GU0n2yZZigsqkS2EhNxchh7CQXMgce9T2czIatT jUdPEhU8kCats1QEPQkS20usonBj1UV1QjftYuGXNKp4TEn4S433UQ== =7yUI -----END PGP SIGNATURE----- --------------enigB4E594856726E75E46D936E0--