Path: csiph.com!usenet.pasdenom.info!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed4.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; '16,': 0.03; 'syntax': 0.04; 'beginner': 0.05; 'float': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; '>on': 0.16; 'confuse': 0.16; 'literal.': 0.16; 'message-id:@4ax.com': 0.16; 'parentheses': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'syntaxerror:': 0.16; 'wrote:': 0.18; 'feb': 0.22; '>>>': 0.22; 'url:home': 0.24; 'question': 0.24; 'equivalent': 0.26; 'header:X -Complaints-To:1': 0.27; 'am,': 0.29; 'subject:list': 0.30; 'easier': 0.31; '-0700,': 0.31; '>>>>': 0.31; 'charset:us-ascii': 0.36; 'starting': 0.37; 'received:76': 0.38; 'to:addr:python- list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'even': 0.60; 'ian': 0.60; "you're": 0.61; 'invalid': 0.68 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dennis Lee Bieber Subject: Re: Explanation of list reference Date: Sun, 16 Feb 2014 12:10:57 -0500 Organization: IISS Elusive Unicorn References: <13208de8-0f85-4e60-b059-dc087c8fda41@googlegroups.com> <917ede6d-db7c-4a8c-8203-27677283776b@googlegroups.com> <871tz5piy0.fsf@elektro.pacujo.net> <87vbwho1i0.fsf@elektro.pacujo.net> <8761ofiio9.fsf@elektro.pacujo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: adsl-76-249-29-222.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 6.00/32.1186 X-No-Archive: YES 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: 33 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1392570906 news.xs4all.nl 2849 [2001:888:2000:d::a6]:50964 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:66558 On Sun, 16 Feb 2014 01:28:34 -0700, Ian Kelly declaimed the following: >On Feb 16, 2014 1:11 AM, "Marko Rauhamaa" wrote: >> >> Marko Rauhamaa : >> >> > Conceptually, the "everything is a reference" and the "small"/"big" >> > distinction are equivalent (produce the same outcomes). The question >> > is, which model is easier for a beginner to grasp. >> >> Case in point, if everything is a reference, how come: >> >> >>> "hello".__str__() >> 'hello' >> >>> 1.__str__() >> SyntaxError: invalid syntax > >You need parentheses around the 1. Otherwise you confuse the lexer, which >thinks you're starting a float literal. > >>>> (1).__str__() >'1' Don't even need the parens... >>> 1 .__str__() '1' >>> -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/