Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #3779

Re: is there a difference between one line and many lines

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <vinograd19@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.115
X-Spam-Level *
X-Spam-Evidence '*H*': 0.78; '*S*': 0.01; 'cpython': 0.07; 'python': 0.07; 'compares': 0.09; 'win32': 0.12; '"is"': 0.16; 'subject:between': 0.16; 'subject:lines': 0.16; 'sure,': 0.16; 'cc:no real name:2**0': 0.20; 'cc:2**0': 0.20; 'header:In-Reply- To:1': 0.22; 'cc:addr:python-list': 0.22; 'memory': 0.24; 'received:209.85.212': 0.25; 'thanks': 0.29; 'cc:addr:python.org': 0.31; 'does': 0.31; 'asking': 0.32; 'lines': 0.34; 'decide': 0.34; 'difference': 0.35; 'there': 0.35; 'header:User-Agent:1': 0.35; 'running': 0.36; 'two': 0.37; 'received:209.85': 0.37; 'depend': 0.38; 'locate': 0.38; 'received:google.com': 0.38; 'happens': 0.38; 'received:209': 0.39; 'cause': 0.65; 'to:addr:googlegroups.com': 0.69; 'reply-to:no real name:2**0': 0.72; 'header:Reply-To:1': 0.72; 'subject:line': 0.73; 'subject:one': 0.73; '256': 0.84; 'received:209.85.212.56': 0.91; 'received:mail-vw0-f56.google.com': 0.91; 'subject:there': 0.91; 'reply-to:addr:googlegroups.com': 0.93
Newsgroups comp.lang.python
Date Thu, 21 Apr 2011 02:55:52 -0700 (PDT)
In-Reply-To <mailman.689.1303379230.9059.python-list@python.org>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=95.25.124.122; posting-account=l5tRawoAAACFkcHvghwtSxtu6TKUeCgn
User-Agent G2/1.0
MIME-Version 1.0
Subject Re: is there a difference between one line and many lines
From vino19 <vinograd19@gmail.com>
To comp.lang.python@googlegroups.com
Content-Type text/plain; charset=ISO-8859-1
Cc python-list@python.org
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
Reply-To comp.lang.python@googlegroups.com
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Message-ID <mailman.690.1303379762.9059.python-list@python.org> (permalink)
Lines 7
NNTP-Posting-Host 82.94.164.166
X-Trace 1303379762 news.xs4all.nl 81475 [::ffff:82.94.164.166]:47072
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:3779

Show key headers only | View raw


Sure, I understand that "is" is not "==", cause "is" just compares id(a)==id(b).

I have a win32 CPython and the range of "singletons" is from -5 to 256 on my machine. 

I am asking about what happens in Python interpreter? Why is there a difference between running one line like "a=1;b=1" and two lines like "a=1 \n b=1"? Does it decide to locate memory in different types depend on a code?

Thanks

Back to comp.lang.python | Previous | NextNext in thread | Find similar


Thread

Re: is there a difference between one line and many lines vino19 <vinograd19@gmail.com> - 2011-04-21 02:55 -0700
  Re: is there a difference between one line and many lines Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-04-21 12:13 +0000
    Re: is there a difference between one line and many lines Peter Otten <__peter__@web.de> - 2011-04-21 14:35 +0200
      Re: is there a difference between one line and many lines Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-04-22 00:25 +0000

csiph-web