. Python 2.1 function attributes

Roy Katz katz at Glue.umd.edu
Sat Jan 27 14:49:23 EST 2001


Hello Moshe,



On Sat, 27 Jan 2001, Moshe Zadka wrote:

> [Roy Katz] 
> > what is wrong with redirection? must we wrap the output in a try:
> > anymore than wrap a standard print in a try:?
> Because if the print raises an exception, I want the stdout to be
> the old one.

Pray tell, what would you do if print to stdout raised an exception? what
would be 'the old one' in that case?  I don't think it is necessary to
wrap print statements in a try.  First off, my programming habits are such
that what is being printed has already been processed and checked for
exceptions.  Logically, the only exception which can be raised then is
from the print statement itself.  And if the system raises an exception
from "print",  then it's the system which is screwed up.  Not my
worry.  stdout, stderr and stdin are pretty much *standard*. 



> > Why stop there? if not statement>>obj, why not 
> > func>>obj? since obj's can implement __call__(self), why
> > not obj>>obj?
> 
> What has any of it got to do with telling "print" to print to some
> other file-like object rather then sys.stdout? Your reductio ad absordum
> has no logical basis.

here:  if we can print>>, why not assert>>?  if print>> and assert>> why
not extend it to other objects, so that they could output their own
messages?  Do you see my point?  it's the incremental feature requests and
changes which result in a large change.  


> > I'm only interested in why it happened at all, and how to prevent it from
> > screwing up our language further :)
> 
> But Guido has been wanting all this to happen sooner -- he just did not
> have the man power.

What concerns me is what *I* want in the language.  Because ultimately it
is Guido, you, me and others who *use* it.  


> > 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.
> 
> Why would anyone care about votes? If you have a rational argument, let's
> hear it. And if you think the Python development doesn't listen to your
> logical arguments, then you're welcome to take Python and develop it in
> a direction that suits you -- the license is quite liberal.

Let's see.  Despite *very* logical arguments against print>>, we still see
it slipped into Python.  Very much like a rider on a bill in US Congress. 
You yourself said there are many against print>>;  I find many of
those arguments rationale (on the basis that the addition of print>>
muddies the langugae).  What more argument do you need?  


> > Let's add bless().  I want to change the class of an object at
> > runtime.
> 
> You can already do this, and have been able to a long time.
> 
> foo.__class__ = new_class
> 
> Why would anyone want a new builtin for that?

Sarcasm; I apologize for not indicating as such. 


> 
> > all this when real issues like typing and making int's first-class objects
> > falls to the wayside. 
> 
> You're welcome to contribute patches.


I would much rather like to discuss it first.  That way we can decide on
it *before* someone slips it in the CVS for good. 


Roey




More information about the Python-list mailing list