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


Groups > comp.lang.python > #107609 > unrolled thread

Re: what is the difference between one-line-operation and 2-line-operation

Started byMichael Torrie <torriem@gmail.com>
First post2016-04-25 08:46 -0600
Last post2016-04-25 08:46 -0600
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: what is the difference between one-line-operation and 2-line-operation Michael Torrie <torriem@gmail.com> - 2016-04-25 08:46 -0600

#107609 — Re: what is the difference between one-line-operation and 2-line-operation

FromMichael Torrie <torriem@gmail.com>
Date2016-04-25 08:46 -0600
SubjectRe: what is the difference between one-line-operation and 2-line-operation
Message-ID<mailman.82.1461595617.32212.python-list@python.org>
On 04/25/2016 08:13 AM, oyster wrote:
> so, what produces this difference between py2 and py3 in nature? is
> there more examples? where can I find the text abiut his difference?

One thing I see is that both your py2 and py3 examples are treating
print as a function.  It's only a function in Py3. By default in Py2
it's a statement.  You passed it a tuple, and that's what it prints.  If
you add:

from __future__ import print_function

then py2 and py3 will behave the same in regards to print.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web