New to Python: Features

Alex Martelli aleaxit at yahoo.com
Wed Oct 6 15:40:11 EDT 2004


Andrew Dalke <adalke at mindspring.com> wrote:
   ...
> Again, my viewpoint is completely detached from any
> practical experience.

In a sense so is mine, 'cuz APL wasn't really about user code fooling
with internals -- so we never had to face this problem... we did (a lot
of) cool _computation_, mostly though not exclusively numeric in nature,
period... the CS types in IBM Research sort of snubbed APL in favour of
Rexx and other pursuits (I sort of had a foot in both camps, but that's
a whole 'nother story... I got by on the basis of CSists looking at me
as a good numeric analyst who happened to get CS more than usual, and
the numeric guys looking at me as a great CSer without the usual disdain
for numerics, and slalomed my way for a decade without anybody ever
noticing I wasn't in IBM Research class in _either_ CS or numerics!-).


> > So would Python plus a rebinding of __builtins__.hex to the above class
> > X.  So?  What's your point?
> 
> That the word 'horror' means something different for you
> than for me.

Apparently.  A feature that _can_ be misused is no horror -- _every_
language has quite a few.


> > Yeah, looks like a cool idea, but Ruby experts tell me it's never really
> > practically useful... much like, say, double-leading-underscores names
> > in Python classes -- neat idea, but not used in best practice anyway.
> 
> Hmm.  I'll bear that in mind.
> 
> One of the things I liked about C++ was constness of
> objects.  And one of the things I didn't like was all
> the extra work needed to make a library const safe.

Yeah, sigh, ditto here, in theory -- then I ended up as the software
consultant for 200+ good programmers new to C++ and saw first-hand what
nightmare it was sometimes to make stuff const-correct and how little in
fact it bought you, so I got rather disillusioned about it.


> I've at times wanted something like that in Python, as
> when I have one attribute which depends on the data in
> another.  Were one to be changed without the other
> there would be an integrity problem.  But I know the
> right Python way to solve that problem if the "we're
> all adults here" solution isn't enough.

Bully for you -- I don't.  I wish I could set a callback on a given
object getting modified or a given name getting rebound - but I can't,
not with enough generality and little-enough black magic to be usable in
production code.


> > Mine too (just started my 50th year -- it's 23 minutes after the end of
> > my 49th b'day, local time), that's part of why google's SO useful;-).
> 
> Buon Compleanno!
> 
> (Or should I say  ¡Buon Compleanno! as you wish Italian to be :)

That depends on whether you like Italy as a _potential_ (what Italy
COULD be at its best) or as an actual place (how it REALLY is).  Knowing
you for a sensible guy, I suspect it's the former (as an actual place
it's often enough hard to accept even for someone native born...), so
the delightful reverse-bang-at-start fantasy may be more appropriate!-)


Alex



More information about the Python-list mailing list