Path: csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail From: Antoon Pardon Newsgroups: comp.lang.python Subject: Re: What is a function parameter =[] for? Date: Tue, 24 Nov 2015 21:54:43 +0100 Lines: 21 Message-ID: References: <8601c9af-a7d9-4642-ba1c-8edd1e4c3390@googlegroups.com> <56546985.8060704@rece.vub.ac.be> <56547337.4000709@rece.vub.ac.be> <56547C53.8030407@rece.vub.ac.be> <5654864E.2070906@rece.vub.ac.be> <56549324.8020607@rece.vub.ac.be> <56549F15.40206@rece.vub.ac.be> <5654B037.6020107@rece.vub.ac.be> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de Dh2Mc6W93FMW2B9Zs+SxTQnfMgkTkXl0s2NE6bvjTkOg== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.053 X-Spam-Evidence: '*H*': 0.90; '*S*': 0.00; 'compiler': 0.05; 'differently': 0.07; '32,': 0.16; '42,': 0.16; '42.': 0.16; 'literal,': 0.16; 'negation': 0.16; 'received:adsl- dyn.isp.belgacom.be': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'byte': 0.18; 'language': 0.19; 'constant': 0.22; 'header:In-Reply-To:1': 0.24; 'module': 0.25; 'header:User-Agent:1': 0.26; 'received:192.168.1.3': 0.29; 'code': 0.30; 'received:be': 0.30; 'point': 0.33; 'picking': 0.33; 'true.': 0.33; 'could': 0.35; "isn't": 0.35; 'but': 0.36; 'to:addr :python-list': 0.36; 'subject:?': 0.36; 'subject:: ': 0.37; 'sure': 0.39; 'received:192': 0.39; 'to:addr:python.org': 0.40; 'charset:windows-1252': 0.62; 'matter': 0.63; 'detail.': 0.66; 'reverse': 0.66; '13)': 0.84; 'pardon': 0.84; 'received:195.238': 0.84; 'schreef': 0.84; 'hand,': 0.97 X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CVAQDHzVRW/9Xi9VENUcNJgWeGDwKBfRIBAQEBAQEBhT8BAQMBeBELIRYPCQMCAQIBRRMIAogiDax3jHWEIwEBCAIBIIZUhH6FJ4QSAQSWVY0ynFgoBIQ8hh0BAQE User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.8.0 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:99394 Op 24-11-15 om 20:15 schreef Ian Kelly: >> But no matter what you want to call it. The dis module shows that >> -42 is treated in exactly the same way as 42, which is treated >> exactly the same way as () or as (5, 8, 13) which is treated >> differently from [] or [5, 8, 13]. > > This is an implementation detail. The compiler would also be free to > compile -42 into byte code as the negation of the constant 42. That 42 > is a literal, on the other hand, is part of the language > specification. I think you are picking nits. Sure the byte code could compile -42 into a byte code for 42 and a negation. Just as it could compile 42 into byte code for adding 32, 8 and 2. The point is, that the reverse isn't true. It couldn't compile [5, 8, 13] into a LOAD_CONST. -- Antoon Pardon