. Python 2.1 function attributes

Roy Katz katz at Glue.umd.edu
Sat Jan 27 13:18:31 EST 2001


Hello Moshe,
thank you for your response. 

first, to be clear,  I mean *no* hostility towards Moshe or anyone else in
this response. 


On Sat, 27 Jan 2001, Moshe Zadka wrote:

> I disagree: in most cases, it was "well, there was a very ugly way to
> do it, but so-and-so came up with a patch and a convincing argument.".
> 
> Examples:
> 
> Printing:
> Standard output is a sinch:
> 
> print foo, bar
> 
> Does lots of things in an intuitive way (prints new lines and spaces,
> calls str()). But when you decide to modify it to print to standard
> error, or a log file it turns into either
> 
> sys.stderr(str(foo)+' '+str(bar)+'\n')
> 
> Or
> 
> sys.stdout = sys.stderr
> try:
> 	print foo, bar
> finally:
> 	sys.stdout = sys.__stdout__
> 

what is wrong with redirection? must we wrap the output in a try:
anymore than wrap a standard print in a try:?


> Compared to both,
> 
> print >>sys.stderr foo, bar
> 
> Is obvious, simple and easy to understand.

Perhaps simple, but to me it looks like it has the potential to be
ambiguating.  If we have print>>file,  why not print>>obj (if not already
so); if we already have print>>obj, why not extend it to
statement>>obj?  Why stop there? if not statement>>obj, why not 
func>>obj? since obj's can implement __call__(self), why
not obj>>obj?

All messed up. 


> List comprehensions:

I'm fine with this. I really am. 

> You may wonder why it all happened all of a sudden? For years, 
> there was one-and-a-half people working on Python seriously who
> could check in directly to the master CVS. Suddenly an explosion
> of developers happened and there were many more man hours to invest
> in Python.

I'm only interested in why it happened at all, and how to prevent it from
screwing up our language further :)

> > I call for boycotting print>>.  I expect one person, maybe less,
> > to support me on that.  

> Sadly, too many people here support you in that. Sadly, because it's
> a feature that was added by people who write a *lot* of Python, and
> wanted to make Python-writing more fun.

Let's see it! petition! vote! who wants and who doesn't?  No more of this
of this 'Benevolent Dictator' or 'Hey I've got a patch' garbage.  *vote*
and make Python not the patcher's language, not my language, and not
yours, but *our* language. Lechayim, people!



Let's add bless().  I want to change the class of an object at
runtime. How 'bout it?  Add @ to indicate a list! that way, instead of 
'stringlist = string.split('\n')' we have '@stringlist = string'.  Oooh! 
another idea! let's add s///.  Damnit, I want dollar signs! And so on. 

all this when real issues like typing and making int's first-class objects
falls to the wayside. 



Na'im lehakir!
Roeykaleh. 










More information about the Python-list mailing list