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

Newsgroups comp.lang.python
Date 2011-04-21 02:55 -0700
Subject Re: is there a difference between one line and many lines
From vino19 <vinograd19@gmail.com>
Message-ID <mailman.690.1303379762.9059.python-list@python.org> (permalink)

Show all headers | 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