Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: Why has python3 been created as a seperate language where thereis still python2.7 ?

Reply
Thread Tools

Re: Why has python3 been created as a seperate language where thereis still python2.7 ?

 
 
rantingrickjohnson@gmail.com
Guest
Posts: n/a
 
      06-28-2012
On Tuesday, June 26, 2012 1:34:03 AM UTC-5, Stefan Behnel wrote:
> First of all, the statement has a rather special syntax that is not obvious
> and practically non-extensible. It also has hidden semantics that are hard
> to explain and mixes formatting with output - soft-space, anyone?
>
> The function is straight forward, configurable, does one thing, works with
> help() and doesn't get in the way. And something as rarely[1] used as a
> print simply doesn't deserve special syntax. Oh, and, yes, you can even
> pass it into some code as callback, although I rarely had a need for that..
>
> Stefan
>
>
> [1] Seriously, it's not very helpful in interactive mode and too simplistic
> to be used in application code. Even scripts often work better with logging
> than with prints.


Unfortunately, even though "print" is supposedly only used by the neophytes, the python<3.0 stdlib is full of print statements. For instance, out of 3173 files, 986 contained the word "print"[1]. Heck just in the Lib folder alone (without recusing down sub directories) there are 1352 instances of "print" in a "py" file!

Naive Nancy Mused: "If only neophtes use print, and the Python Lib is full of prints statements, then the python developers must be...OH DEAR GAWD!"

[1] of course that is when using `filestr.count("print")` -- I assume that the word "print" is not used excessively in comments or docstrings. Someoneelse can do a less naive search if they like.
 
Reply With Quote
 
 
 
 
rantingrickjohnson@gmail.com
Guest
Posts: n/a
 
      06-28-2012
On Tuesday, June 26, 2012 1:34:03 AM UTC-5, Stefan Behnel wrote:
> First of all, the statement has a rather special syntax that is not obvious
> and practically non-extensible. It also has hidden semantics that are hard
> to explain and mixes formatting with output - soft-space, anyone?
>
> The function is straight forward, configurable, does one thing, works with
> help() and doesn't get in the way. And something as rarely[1] used as a
> print simply doesn't deserve special syntax. Oh, and, yes, you can even
> pass it into some code as callback, although I rarely had a need for that..
>
> Stefan
>
>
> [1] Seriously, it's not very helpful in interactive mode and too simplistic
> to be used in application code. Even scripts often work better with logging
> than with prints.


Unfortunately, even though "print" is supposedly only used by the neophytes, the python<3.0 stdlib is full of print statements. For instance, out of 3173 files, 986 contained the word "print"[1]. Heck just in the Lib folder alone (without recusing down sub directories) there are 1352 instances of "print" in a "py" file!

Naive Nancy Mused: "If only neophtes use print, and the Python Lib is full of prints statements, then the python developers must be...OH DEAR GAWD!"

[1] of course that is when using `filestr.count("print")` -- I assume that the word "print" is not used excessively in comments or docstrings. Someoneelse can do a less naive search if they like.
 
Reply With Quote
 
 
 
 
alex23
Guest
Posts: n/a
 
      06-28-2012
Rick, fix your mail reader/sender, your lines aren't wrapping
properly.

On Jun 28, 1:53*pm, (E-Mail Removed) wrote:
> Unfortunately, even though "print" is supposedly only used by the neophytes, the python<3.0 stdlib is full of print statements. For instance, out of3173 files, 986 contained the word "print"[1]. Heck just in the Lib folderalone (without recusing down sub directories) there are 1352 instances of "print" in a "py" file!


Stefan said "rarely used". Until you count all keywords & built-ins in
those files and provide a relative basis of comparison, you're not
saying anything here.

> Naive Nancy Mused: "If only neophtes use print, and the Python Lib is full of prints statements, then the python developers must be...OH DEAR GAWD!"


It's a good thing there's no open flame around given the sheer number
of strawmen you stuff into your posts.

No one made any such claim about "neophytes", just that logging can be
better than print() as a general debugging tool.

> [1] of course that is when using `filestr.count("print")` -- I assume that the word "print" is not used excessively in comments or docstrings. Someone else can do a less naive search if they like.


So you couldn't even be bothered to do it right, but you're happy to
form a noisy opinion on this crap, and now the onus is on someone else
to correct the ignorance you've pushed onto this list. Again.
 
Reply With Quote
 
Steven D'Aprano
Guest
Posts: n/a
 
      06-28-2012
On Wed, 27 Jun 2012 17:44:23 -0700, alex23 wrote:

> If you believe providing a complementary __past__ namespace will work -
> even though I believe Guido has explicitly stated it will never happen -
> then the onus is on you to come up with an implementation.


Guido speaks only for CPython. Other implementations can always do
differently.

The Python 3 naysayers are welcome to fork Python 2.7 and support it
forever, with or without a __past__ namespace. That's the power of open
source software.

And who knows, if it becomes popular enough, perhaps it will be ported to
CPython too.



--
Steven
 
Reply With Quote
 
Serhiy Storchaka
Guest
Posts: n/a
 
      06-28-2012
On 28.06.12 00:14, Terry Reedy wrote:
> Another prediction: people who code Python without reading the manual,
> at least not for new features, will learn about 'u' somehow (such as by
> reading this list) and may do either of the following, both of which are
> bad.
>
> 1. They will confuse themselves by thinking that 'u' actually means
> somethings. They may then confuse others by writing about its supposed
> meaning. This might get amusing.
>
> 2. They will use 'u' in Python 3 only code, thereby making it
> incompatible with 3.2-, even if it otherwise would not be.
>
> These two actions will reinforce each other.


Yes, this is what I mean. I can even make a prediction: in just 5 years,
as this feature would be banned in a decent society. The authors of the
books will be strongly advise not to use it, and in software companies
'u' will be prohibited in coding style. But get rid of this will be
difficult.

 
Reply With Quote
 
Stefan Behnel
Guest
Posts: n/a
 
      06-28-2012
Serhiy Storchaka, 28.06.2012 07:36:
> On 28.06.12 00:14, Terry Reedy wrote:
>> Another prediction: people who code Python without reading the manual,
>> at least not for new features, will learn about 'u' somehow (such as by
>> reading this list) and may do either of the following, both of which are
>> bad.
>>
>> 1. They will confuse themselves by thinking that 'u' actually means
>> somethings. They may then confuse others by writing about its supposed
>> meaning. This might get amusing.
>>
>> 2. They will use 'u' in Python 3 only code, thereby making it
>> incompatible with 3.2-, even if it otherwise would not be.
>>
>> These two actions will reinforce each other.

>
> Yes, this is what I mean. I can even make a prediction: in just 5 years, as
> this feature would be banned in a decent society. The authors of the books
> will be strongly advise not to use it, and in software companies 'u' will
> be prohibited in coding style. But get rid of this will be difficult.


Once Py2.7 is out of maintenance, we can deprecate that feature in one
release and start warning about it in the next one. You're then free to use
the corresponding 2to3 fixer to get it back out of your code with a single
patch.

Stefan

 
Reply With Quote
 
wxjmfauth@gmail.com
Guest
Posts: n/a
 
      06-28-2012
On Thursday, June 28, 2012 7:47:24 AM UTC+2, Stefan Behnel wrote:
> Serhiy Storchaka, 28.06.2012 07:36:
> > On 28.06.12 00:14, Terry Reedy wrote:
> >> Another prediction: people who code Python without reading the manual,
> >> at least not for new features, will learn about 'u' somehow (such as by
> >> reading this list) and may do either of the following, both of which are
> >> bad.
> >>
> >> 1. They will confuse themselves by thinking that 'u' actually means
> >> somethings. They may then confuse others by writing about its supposed
> >> meaning. This might get amusing.
> >>
> >> 2. They will use 'u' in Python 3 only code, thereby making it
> >> incompatible with 3.2-, even if it otherwise would not be.
> >>
> >> These two actions will reinforce each other.

> >
> > Yes, this is what I mean. I can even make a prediction: in just 5 years, as
> > this feature would be banned in a decent society. The authors of the books
> > will be strongly advise not to use it, and in software companies 'u' will
> > be prohibited in coding style. But get rid of this will be difficult.

>
> Once Py2.7 is out of maintenance, we can deprecate that feature in one
> release and start warning about it in the next one. You're then free to use
> the corresponding 2to3 fixer to get it back out of your code with a single
> patch.
>
> Stefan


On the other side, one can argue this (elegancy):

b'a serie of bytes'
u'a unicode, a serie of code points'

'python2? str? python3? encoded _unicode?'

jmf
 
Reply With Quote
 
wxjmfauth@gmail.com
Guest
Posts: n/a
 
      06-28-2012
On Thursday, June 28, 2012 7:47:24 AM UTC+2, Stefan Behnel wrote:
> Serhiy Storchaka, 28.06.2012 07:36:
> > On 28.06.12 00:14, Terry Reedy wrote:
> >> Another prediction: people who code Python without reading the manual,
> >> at least not for new features, will learn about 'u' somehow (such as by
> >> reading this list) and may do either of the following, both of which are
> >> bad.
> >>
> >> 1. They will confuse themselves by thinking that 'u' actually means
> >> somethings. They may then confuse others by writing about its supposed
> >> meaning. This might get amusing.
> >>
> >> 2. They will use 'u' in Python 3 only code, thereby making it
> >> incompatible with 3.2-, even if it otherwise would not be.
> >>
> >> These two actions will reinforce each other.

> >
> > Yes, this is what I mean. I can even make a prediction: in just 5 years, as
> > this feature would be banned in a decent society. The authors of the books
> > will be strongly advise not to use it, and in software companies 'u' will
> > be prohibited in coding style. But get rid of this will be difficult.

>
> Once Py2.7 is out of maintenance, we can deprecate that feature in one
> release and start warning about it in the next one. You're then free to use
> the corresponding 2to3 fixer to get it back out of your code with a single
> patch.
>
> Stefan


On the other side, one can argue this (elegancy):

b'a serie of bytes'
u'a unicode, a serie of code points'

'python2? str? python3? encoded _unicode?'

jmf
 
Reply With Quote
 
Chris Angelico
Guest
Posts: n/a
 
      06-28-2012
On Thu, Jun 28, 2012 at 7:34 PM, <(E-Mail Removed)> wrote:
> On the other side, one can argue this (elegancy):
>
> b'a series of bytes'
> u'a unicode, a series of code points'


Alas, not perfectly so. A 'bytes' object and a 'unicode' object can be
described that way (with 'str' an alias for one or t'other), but
literal strings are never that simple. (Backslash escapes, delimiters,
newlines, etc, etc, etc.) However, it is a nice idea, to the extent
that it's possible.

ChrisA
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why the destructor executes after its friend operator (in which thereis a copy constructor) runs fl C++ 5 01-06-2013 08:32 PM
Re: Why has python3 been created as a seperate language where thereis still python2.7 ? Stefan Behnel Python 3 06-26-2012 10:37 PM
Re: Why has python3 been created as a seperate language where thereis still python2.7 ? Andrew Berg Python 0 06-25-2012 08:48 AM
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
The printing has been stopped and this job has been add to the queu? dejola Computer Support 6 12-30-2005 03:26 AM



Advertisments