gratuitous new features in 2.0

Martijn Faassen m.faassen at vet.uu.nl
Sat Aug 26 09:03:44 EDT 2000


Aahz Maruch <aahz at netcom.com> wrote:
> In article <8o6sje$fi2$2 at newshost.accu.uu.nl>,
> Martijn Faassen <m.faassen at vet.uu.nl> wrote:
>>
>>So, while I don't mind the print statement, is there something else that
>>makes print special that we're overlooking? Otherwise it would seem to be
>>smarter just to introduce this system of functions instead. Eventually we
>>could then even deprecate the statement; Python seems to be dynamic enough
>>to be able to do without, without losing the flexibility.

> I'm going to repeat myself, just in case you didn't see my earlier post:

I think I saw it but it didn't make a deep lasting impression. :)

> There's something simple and magical about just doing

>>>> print 1+1
> 2

> for a new programmer.  It's not the same if the new person has to type

>>>> print(1+1)
> 2

> From my POV that simple magic is an essential ingredient in exciting and
> inspiring new programmers to keep plugging away.  As someone said
> earlier today, one of the glories of Python is that it does *NOT*
> attempt to pigeonhole everything into the OOP paradigm.

Well, to be honest I don't really see how the ( and ) are that terrible,
removing the magic completely. After all, when you teach someone programming
you will *have* to move into builtin functions such as str() and int()
fairly quickly, I think. You mean that the new programmer has to learn that
a ( is followed by a )?

Worrying about not overloading the newbie
programmer with complicated syntax is a valid concern in general, but
I think here one would be overdoing it.

In addition, if you don't deprecate the print statement, adding a few
methods in some places would seem to be a far cleaner solution than
messing with the language syntax. I know Guido disagrees, as after making
my posts yesterday I saw a postfix to the PEP stating his responses to
some of these concerns. But Guido as well seems to indicate he isn't 100%
sure either way, statement or function.

I'd say that the need to add a >> to the language does weigh the evaluation
in the direction of a print function (or method). :)

Finally, I don't see how my suggestions were trying to pingeonhole things into
the OO paradigm at all. I was advocating the use of methods
for advanced use (such as redirecting), sure. I think that's not 
attempting to 'pingeonhole' though, I think that is a natural use of methods.
Furthermore, I don't see how anyone mentioning bare functions at all could be
accused of pingeonholing anything into OO.
 
Regards,

Martijn
-- 
History of the 20th Century: WW1, WW2, WW3?
No, WWW -- Could we be going in the right direction?



More information about the Python-list mailing list