. Python 2.1 function attributes

Roy Katz katz at Glue.umd.edu
Sat Jan 27 12:12:07 EST 2001


On Sat, 27 Jan 2001, Robin Becker wrote:

> >>>> def f(x * [x-1 for x > 1]) << x: pass

ohmigod, that's like a bad dream..

> >...
> >>>> print f.x = 5
> >120
weird! wouldn't it be clearer with a functor? wink, wink!


> aaarrggghhhh the Inquisition auto da fe with << and >>
it's what you oughtn't to do but you do anyway :)

IMHO, the above History of the World quote applies to our topic
precisely :)

Yeah, I was griping about the language going to hell and I meant it.  I
don't mean to return to Python 1.3 days, but some things (notably
print>>) contribute a fair share towards Perlization. 

Given Python's current "there's a right way to do it" motto, and
its recent TMTOWTDIfication, perhaps a more fitting one would be
"yeah, but so-and-so came up with a patch, and we couldn't resist, so we
included it. So deal."  History of the World. Now there is print>> and
write().  I call for boycotting print>>.  I expect one person, maybe less,
to support me on that.  

I fully expect to see blocking delimiters in the next Python
incarnation.  Onward {Christian,Jewish,..}  Soldiers! to
Perl! (perlwards!)


To be more optmistic:  I would like to see more of a unification between
functions and classes. See my other post.  Perhaps a type which is both a
class and a function simultaneously (a 'type')?

type myClassAndFunc(self, x) extends ParentClassAndFunc:
     data = x         # static data
     print data       # when called as myClassAndFunc(

     type meth1(self): pass   # method
     type meth2(self): pass   # method

Just brainstorming :)


Roey

Got Patches?





More information about the Python-list mailing list