Re: Pep 3105: the end of print?

2007-02-27 Thread Christophe
Martin v. Löwis a écrit : > Neil Cerutti schrieb: >> On 2007-02-23, I V <[EMAIL PROTECTED]> wrote: >>> While that's true, C++ compiler vendors, for example, take >>> backwards compatibility significantly less seriously, it seems >>> to me. >> Compiler vendors usually take care of their customers w

Re: Pep 3105: the end of print?

2007-02-26 Thread Martin v. Löwis
Neil Cerutti schrieb: > On 2007-02-23, I V <[EMAIL PROTECTED]> wrote: >> While that's true, C++ compiler vendors, for example, take >> backwards compatibility significantly less seriously, it seems >> to me. > > Compiler vendors usually take care of their customers with > compiler switches that e

Re: Pep 3105: the end of print?

2007-02-26 Thread Martin v. Löwis
Edward K Ream schrieb: > In other words, the consequence of pep 3105 will be that *nobody* who wants > their app to be portable will be able to use print until *everybody* has > converted to Python 3.x. I doubt that is what Guido had in mind, but I may > be mistaken :-) That's not true. Many

Re: Pep 3105: the end of print?

2007-02-26 Thread Neil Cerutti
On 2007-02-23, I V <[EMAIL PROTECTED]> wrote: > On Tue, 20 Feb 2007 10:46:31 -0800, Beliavsky wrote: >> I think the C and C++ committees also take backwards >> compatibility seriously, in part because they know that >> working programmers will ignore them if they break too much >> old code. > > Whi

Re: Pep 3105: the end of print?

2007-02-23 Thread Aahz
In article <[EMAIL PROTECTED]>, Jay Tee <[EMAIL PROTECTED]> wrote: > >On the other hand, C++ is firmly established as a "serious" language >in our community while python is not. So the programmers tend to be >more forgiving. There is no perception that compiler developers are >*trying* to be diff

Re: Pep 3105: the end of print?

2007-02-23 Thread Jay Tee
On Feb 23, 8:48 am, I V <[EMAIL PROTECTED]> wrote: > While that's true, C++ compiler vendors, for example, take backwards > compatibility significantly less seriously, it seems to me. A year or so > ago, I tried compiling something I'd written for g++ 2, using a > then-recent-ish g++ 3; it failed

Re: Pep 3105: the end of print?

2007-02-22 Thread I V
On Tue, 20 Feb 2007 10:46:31 -0800, Beliavsky wrote: > I think the C and C++ committees also take backwards compatibility > seriously, in part because they know > that working programmers will ignore them if they break too much old > code. While that's true, C++ compiler vendors, for example, take

Re: Pep 3105: the end of print?

2007-02-22 Thread Steven D'Aprano
On Thu, 22 Feb 2007 16:29:17 +1100, Peter Mayne wrote: > Why use print in the interactive interpreter? Just type the expression. Many reasons. Here are four: >>> print None None >>> None >>> print 0.1 0.1 >>> 0.1 0.10001 >>> print 'null = \0' null = >>> 'null = \0' 'null = \x00' >>>

Re: Pep 3105: the end of print?

2007-02-21 Thread Peter Mayne
Steven D'Aprano wrote: > On Tue, 20 Feb 2007 00:44:24 +, Peter mayne wrote: > >> Steven D'Aprano wrote: >>> If Python 3 dropped the print >>> statement and replaced it with official_print_function(), how would that >>> help you in your goal to have a single code base that will run on both >>>

Re: Pep 3105: the end of print?

2007-02-20 Thread Beliavsky
On Feb 16, 10:17 am, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Fri, 16 Feb 2007 09:49:03 -0500, Jean-Paul Calderone wrote: > > On Sat, 17 Feb 2007 01:32:21 +1100, Steven D'Aprano > >> [snip] > > >>I don't think that follows at all. print is only a problem if you expect > >>your code to work u

Re: Pep 3105: the end of print?

2007-02-20 Thread Steven D'Aprano
On Tue, 20 Feb 2007 00:44:24 +, Peter mayne wrote: > Steven D'Aprano wrote: >> If Python 3 dropped the print >> statement and replaced it with official_print_function(), how would that >> help you in your goal to have a single code base that will run on both >> Python 2.3 and Python 3, while s

Re: Pep 3105: the end of print?

2007-02-19 Thread Peter mayne
Steven D'Aprano wrote: > If Python 3 dropped the print > statement and replaced it with official_print_function(), how would that > help you in your goal to have a single code base that will run on both > Python 2.3 and Python 3, while still using print? Is there any reason why official_print_func

Re: Pep 3105: the end of print?

2007-02-17 Thread Hendrik van Rooyen
"Steve Holden" <[EMAIL PROTECTED]> wrote: > Jean-Paul Calderone wrote: > > > > I think some people are confused that the language "Python 3.x" has "Python" > > in its name, since there is already a language with "Python" in its name, > > with which it is not compatible. > > > Right. Let's call Py

Re: Pep 3105: the end of print?

2007-02-16 Thread Klaas
On Feb 16, 2:31 pm, Sam <[EMAIL PROTECTED]> wrote: >pass > except (ImportError, SyntaxError): ># python 3.0 >print2 = print > SyntaxError: invalid syntax > > Any and all aliasing must happen in compat26.py. My suggested solution is > this: Good catch. Point is that it is not impossib

Re: Pep 3105: the end of print?

2007-02-16 Thread Sam
On 16 Feb 2007 13:48:29 -0800, Klaas <[EMAIL PROTECTED]> wrote: > 3. in your code: > try: > from compat26 import print2 > except (ImportError, SyntaxError): > # python 3.0 > print2 = print Python 2.5c1 (r25c1:51305, Aug 17 2006, 10:41:11) [MSC v.1310 32 bit (Intel)] on win32 Type "copy

Re: Pep 3105: the end of print?

2007-02-16 Thread Klaas
On Feb 16, 6:01 am, "Edward K Ream" <[EMAIL PROTECTED]> wrote: > That's the proof. Can you find a flaw in it? Casting this in terms of theorem proving only obfuscates the discussion. Here is how to maintain a single codebase for this feature: 1. Convert all your print statements to 3.0 print f

Re: Pep 3105: the end of print?

2007-02-16 Thread Tobias Brox
[Edward K Ream] > Not at all. Backwards compatibility means that one can still run old code > provided the code eschews new features. Python releases have generally > been backwards compatible with previous releases, with a few minor > exceptions. For example, my app runs fine on Python 2.2.

Re: Pep 3105: the end of print?

2007-02-16 Thread Edward K Ream
> But that doesn't just happen. True, but it didn't happen as you imply. Leo's core defines a gui-and-platform-independent set of api's which then get instantiated in plugins. Plugins can, and do, use platform-dependent features. For example, the wxWidgets plugin uses the scintilla text widg

Re: Pep 3105: the end of print?

2007-02-16 Thread Steve Holden
Jean-Paul Calderone wrote: > On Sat, 17 Feb 2007 01:32:21 +1100, Steven D'Aprano >> [snip] >> >> I don't think that follows at all. print is only a problem if you expect >> your code to work under both Python 2.x and 3.x. I wouldn't imagine >> that many people are going to expect that: I know I do

Re: Pep 3105: the end of print?

2007-02-16 Thread Steven D'Aprano
On Fri, 16 Feb 2007 09:32:56 -0600, Edward K Ream wrote: >> Even in the Python world, nobody expects to run the same code base under > C Python and Jython and IronPython and PyPy. > > Leo now runs under CPython with both wxWidgets and Tkinter. The gui code is > confined to plugins, and a similar

Re: Pep 3105: the end of print?

2007-02-16 Thread Jean-Paul Calderone
On Fri, 16 Feb 2007 16:49:05 +0100, BJörn Lindqvist <[EMAIL PROTECTED]> wrote: >On 2/16/07, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: >>I was just pointing out that some people might be confused. I didn't make >>any judgement about that fact. You seem to be suggesting that because >>there >

Re: Pep 3105: the end of print?

2007-02-16 Thread BJörn Lindqvist
On 2/16/07, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > I was just pointing out that some people might be confused. I didn't make > any judgement about that fact. You seem to be suggesting that because there > are other confusing things, it's okay for Python to be confusing too. I'm > not m

Re: Pep 3105: the end of print?

2007-02-16 Thread Edward K Ream
> Keep the print name; > Keep the print functionality; > Keep a single code base. Retain the print statement and its functionality, and define an official_print_function to be used in the common code base. I would be satisfied with this (it's what I do now), and it would cause no needless prob

Re: Pep 3105: the end of print?

2007-02-16 Thread Steven D'Aprano
On Fri, 16 Feb 2007 09:07:02 -0600, Edward K Ream wrote: >>> That's the proof. Can you find a flaw in it? >> No, but it doesn't matter. There's no particular reason why you have to >> write "print (whatever)" in your code. What you need is *some function* >> that is capable of duplicating the fun

Re: Pep 3105: the end of print?

2007-02-16 Thread Edward K Ream
> Even in the Python world, nobody expects to run the same code base under C Python and Jython and IronPython and PyPy. Leo now runs under CPython with both wxWidgets and Tkinter. The gui code is confined to plugins, and a similar gui plugin will suffice to run Leo under IronPython. Indeed, Leo

Re: Pep 3105: the end of print?

2007-02-16 Thread Jean-Paul Calderone
On Sat, 17 Feb 2007 02:17:23 +1100, Steven D'Aprano <[EMAIL PROTECTED]> wrote: >On Fri, 16 Feb 2007 09:49:03 -0500, Jean-Paul Calderone wrote: > >> On Sat, 17 Feb 2007 01:32:21 +1100, Steven D'Aprano >>> [snip] >>> >>>I don't think that follows at all. print is only a problem if you expect >>>your

Re: Pep 3105: the end of print?

2007-02-16 Thread Fuzzyman
On Feb 16, 3:00 pm, "Edward K Ream" <[EMAIL PROTECTED]> wrote: > > So you only have one codebase to maintain and you can still use print... > > Not if the theorum is correct. > > > It may be true that you won't be able to write code that runs > > untranslated on 2 and 3. > > That's my definition of

Re: Pep 3105: the end of print?

2007-02-16 Thread Fuzzyman
On Feb 16, 2:54 pm, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Fri, 16 Feb 2007 06:42:55 -0800, Fuzzyman wrote: > > I mentioned the 2to3 translator- the goal of which is *precisely* to > > allow you to write code that will run on Python 2.X and when > > translated run under Python 3.0. > > Unf

Re: Pep 3105: the end of print?

2007-02-16 Thread Steven D'Aprano
On Fri, 16 Feb 2007 09:49:03 -0500, Jean-Paul Calderone wrote: > On Sat, 17 Feb 2007 01:32:21 +1100, Steven D'Aprano >> [snip] >> >>I don't think that follows at all. print is only a problem if you expect >>your code to work under both Python 2.x and 3.x. I wouldn't imagine >>that many people are

Re: Pep 3105: the end of print?

2007-02-16 Thread Edward K Ream
>> That's the proof. Can you find a flaw in it? > No, but it doesn't matter. There's no particular reason why you have to > write "print (whatever)" in your code. What you need is *some function* > that is capable of duplicating the functionality of print, Precisely wrong. The title of this thre

Re: Pep 3105: the end of print?

2007-02-16 Thread Edward K Ream
> So you only have one codebase to maintain and you can still use print... Not if the theorum is correct. > It may be true that you won't be able to write code that runs > untranslated on 2 and 3. That's my definition of a common code base. That is the content of the theorum. > That doesn't

Re: Pep 3105: the end of print?

2007-02-16 Thread Steven D'Aprano
On Fri, 16 Feb 2007 06:42:55 -0800, Fuzzyman wrote: > I mentioned the 2to3 translator- the goal of which is *precisely* to > allow you to write code that will run on Python 2.X and when > translated run under Python 3.0. Unfortunately, that is not a realistic goal for the 2to3 translator. The goa

Re: Pep 3105: the end of print?

2007-02-16 Thread Steven D'Aprano
On Fri, 16 Feb 2007 08:01:11 -0600, Edward K Ream wrote: >> Why won't it be possible to make 'print' in Python 3 that supports all >> the functionality of the current print statement, and then translate to >> that ? >> I saw an assertion to the effect that it wasn't possible - but no proof. > > A

Re: Pep 3105: the end of print?

2007-02-16 Thread Edward K Ream
> It looks your main issue is that you're complaining that Python 3000 is going to break things in a non-backward compatible way. No. My complaint is *only* that changing the meaning of 'print' is needless pain. Edward Edward

Re: Pep 3105: the end of print?

2007-02-16 Thread Jean-Paul Calderone
On Sat, 17 Feb 2007 01:32:21 +1100, Steven D'Aprano > [snip] > >I don't think that follows at all. print is only a problem if you expect >your code to work under both Python 2.x and 3.x. I wouldn't imagine >that many people are going to expect that: I know I don't. I think some people are confuse

Re: Pep 3105: the end of print?

2007-02-16 Thread Stefan Rank
on 16.02.2007 13:02 Edward K Ream said the following: >> There are a tool called "2to3" that translates things like "print foo" to >> print(foo). > > The point of my original post was that if I want to maintain a common code > base the tool must translate 'print foo' to 'print2(foo)'. I think y

Re: Pep 3105: the end of print?

2007-02-16 Thread Edward K Ream
> print is only a problem if you expect your code to work under both Python > 2.x and 3.x. Exactly. Edward Edward K. Ream email: [EMAIL PROTECTED] Leo: http://webpages.charter.net/edreamleo/front.html ---

Re: Pep 3105: the end of print?

2007-02-16 Thread Fuzzyman
On Feb 16, 2:01 pm, "Edward K Ream" <[EMAIL PROTECTED]> wrote: > > Why won't it be possible to make 'print' in Python 3 that supports all > > the functionality of the current print statement, and then translate to > > that ? > > I saw an assertion to the effect that it wasn't possible - but no proo

Re: Pep 3105: the end of print?

2007-02-16 Thread Steven D'Aprano
On Fri, 16 Feb 2007 06:07:42 -0600, Edward K Ream wrote: >> I'm pretty sure you're mistaken. Python 3 will be the release that breaks >> code. Hopefully very little, but there almost certainly will be some. > > Pep 3105 breaks a *lot* of code, despite the bland assertion that most > production pr

Re: Pep 3105: the end of print?

2007-02-16 Thread Roel Schroeven
Edward K Ream schreef: >> There are a tool called "2to3" that translates things like "print foo" to >> print(foo). > > The point of my original post was that if I want to maintain a common code > base the tool must translate 'print foo' to 'print2(foo)'. At first sight it seems to me that it's

Re: Pep 3105: the end of print?

2007-02-16 Thread Roel Schroeven
Edward K Ream schreef: >> I'm pretty sure you're mistaken. Python 3 will be the release that breaks >> code. Hopefully very little, but there almost certainly will be some. > > Pep 3105 breaks a *lot* of code, despite the bland assertion that most > production programs don't use print. > > Presum

Re: Pep 3105: the end of print?

2007-02-16 Thread Edward K Ream
> Why won't it be possible to make 'print' in Python 3 that supports all > the functionality of the current print statement, and then translate to > that ? > I saw an assertion to the effect that it wasn't possible - but no proof. As discussed in the original post, the problem is the reverse: the

Re: Pep 3105: the end of print?

2007-02-16 Thread Fuzzyman
On Feb 16, 12:47 pm, "Edward K Ream" <[EMAIL PROTECTED]> wrote: > > There is also the 2to3 converter. The aim is that this will be > > effective enough that coders should be able to maintain a 2.X (2.6 ?) > codebase, run it through 2to3 and have the result run unchanged on > Python 3. That way ther

Re: Pep 3105: the end of print?

2007-02-16 Thread Peter Otten
Edward K Ream wrote: >> There could be something like from __future__ import print_function > > To repeat: this would be compatible only with Python 2.6. Indeed. Don't lose your nerves over that bunch of casual readers of your thread :-) Peter -- http://mail.python.org/mailman/listinfo/pytho

Re: Pep 3105: the end of print?

2007-02-16 Thread Edward K Ream
> There could be something like from __future__ import print_function To repeat: this would be compatible only with Python 2.6. Edward Edward K. Ream email: [EMAIL PROTECTED] Leo: http://webpages.charter.net/edreamleo/front.

Re: Pep 3105: the end of print?

2007-02-16 Thread Peter Otten
Edward K Ream wrote: >> There is also the 2to3 converter. The aim is that this will be > effective enough that coders should be able to maintain a 2.X (2.6 ?) > codebase, run it through 2to3 and have the result run unchanged on > Python 3. That way there will be no need to maintain two code bases.

Re: Pep 3105: the end of print?

2007-02-16 Thread Edward K Ream
> There is also the 2to3 converter. The aim is that this will be effective enough that coders should be able to maintain a 2.X (2.6 ?) codebase, run it through 2to3 and have the result run unchanged on Python 3. That way there will be no need to maintain two code bases. I have offered a proof that

Re: Pep 3105: the end of print?

2007-02-16 Thread Fuzzyman
On Feb 16, 11:54 am, "Edward K Ream" <[EMAIL PROTECTED]> wrote: > > In short, if you need to support 2.3, you're not ready to be looking at > > 3.0. > > I hope this turns out not to be true. As a developer, I have no way to > force people to 3.0, and no reason to want to. For me, maintaining two

Re: Pep 3105: the end of print?

2007-02-16 Thread Edward K Ream
> Is that what you intend to say? I intended to say what I did say: "Python releases have generally been backwards compatible with previous releases, with a few minor exceptions." Imo, this is compatible with what you are saying. > So long as it's done in a well-documented way, with a change in

Re: Pep 3105: the end of print?

2007-02-16 Thread Edward K Ream
> I'm pretty sure you're mistaken. Python 3 will be the release that breaks > code. Hopefully very little, but there almost certainly will be some. Pep 3105 breaks a *lot* of code, despite the bland assertion that most production programs don't use print. Presumably, Guido wanted to improve print

Re: Pep 3105: the end of print?

2007-02-16 Thread Edward K Ream
> There are a tool called "2to3" that translates things like "print foo" to > print(foo). The point of my original post was that if I want to maintain a common code base the tool must translate 'print foo' to 'print2(foo)'. Edward

Re: Pep 3105: the end of print?

2007-02-16 Thread Edward K Ream
> In short, if you need to support 2.3, you're not ready to be looking at > 3.0. I hope this turns out not to be true. As a developer, I have no way to force people to 3.0, and no reason to want to. For me, maintaining two incompatible code bases is out of the question. It will be interesti

Re: Pep 3105: the end of print?

2007-02-16 Thread Eduardo \"EdCrypt\" O. Padoan
On 2/15/07, Edward K Ream <[EMAIL PROTECTED]> wrote: > > Isn't the very concept of major releases (1.x, 2.x, 3.x) that they *can* > > be not backwards-compatible with previous releases? > > Not at all. [...] It is the only intent of Python 3.0: be free of backward compatibity constraints. There ar

Re: Pep 3105: the end of print?

2007-02-16 Thread Steven D'Aprano
On Thu, 15 Feb 2007 19:04:34 -0600, Edward K Ream wrote: >> Isn't the very concept of major releases (1.x, 2.x, 3.x) that they *can* >> be not backwards-compatible with previous releases? > > Not at all. Backwards compatibility means that one can still run old code > provided the code eschews

Re: Pep 3105: the end of print?

2007-02-15 Thread Steven Bethard
Edward K Ream wrote: >> You could offer up a patch for Python 2.6 so that you can do:: >>from __future__ import print_function > > This would only work for Python 2.6. Developers might want to support Python > 2.3 through 2.5 for awhile longer :-) Python 3.0 is determined not to be hampered

Re: Pep 3105: the end of print?

2007-02-15 Thread Ben Finney
"Edward K Ream" <[EMAIL PROTECTED]> writes: > > Isn't the very concept of major releases (1.x, 2.x, 3.x) that they > > *can* be not backwards-compatible with previous releases? > > Not at all. In the context of the question, this answer seems to say that a major release *must* be backwards-compat

Re: Pep 3105: the end of print?

2007-02-15 Thread Gabriel Genellina
En Thu, 15 Feb 2007 22:04:34 -0300, Edward K Ream <[EMAIL PROTECTED]> escribió: > In other words, the consequence of pep 3105 will be that *nobody* who > wants > their app to be portable will be able to use print until *everybody* has > converted to Python 3.x. I doubt that is what Guido had

Re: Pep 3105: the end of print?

2007-02-15 Thread Edward K Ream
> Isn't the very concept of major releases (1.x, 2.x, 3.x) that they *can* > be not backwards-compatible with previous releases? Not at all. Backwards compatibility means that one can still run old code provided the code eschews new features. Python releases have generally been backwards com

Re: Pep 3105: the end of print?

2007-02-15 Thread massimo s.
Isn't the very concept of major releases (1.x, 2.x, 3.x) that they *can* be not backwards-compatible with previous releases? m. -- http://mail.python.org/mailman/listinfo/python-list

Re: Pep 3105: the end of print?

2007-02-15 Thread Edward K Ream
> You could offer up a patch for Python 2.6 so that you can do:: >from __future__ import print_function This would only work for Python 2.6. Developers might want to support Python 2.3 through 2.5 for awhile longer :-) > why can't you use ``file.write()`` instead of ``print``? Precisely my

Re: Pep 3105: the end of print?

2007-02-15 Thread Steven Bethard
Edward K Ream wrote: > The pros and cons of making 'print' a function in Python 3.x are well > discussed at: > > http://mail.python.org/pipermail/python-dev/2005-September/056154.html > > Alas, it appears that the effect of this pep would be to make it impossible > to use the name 'print' in a ba

Pep 3105: the end of print?

2007-02-15 Thread Edward K Ream
The pros and cons of making 'print' a function in Python 3.x are well discussed at: http://mail.python.org/pipermail/python-dev/2005-September/056154.html Alas, it appears that the effect of this pep would be to make it impossible to use the name 'print' in a backward compatible manner. Indeed, i