about sort and dictionary

bonono at gmail.com bonono at gmail.com
Wed Nov 23 22:37:52 EST 2005


rurpy at yahoo.com wrote:
> "do things right" is my fundamental beef with Python.
> Dispite claims, I don't believe Python's designers have
> a monopoly on the definition of "right".
I think raymond's post more correctly described it. Rather than do
things right, it is more the "world view of python", just that it has
been pushed too far in certain situation(mostly unconciously) and
turning it into a holy war. We seem to see it every where, not just
about a programming language though.

>
> > it also avoids the mistake of introducing hurdles in a
> > vain attempts to prevent programmer mistakes. Such hurdles
> > typically lead to ugly workarounds. There are a few cases
> > when things don't work as some people would expect them
> > to work, but I think there are good resons for that.
> >
> > I'm surprised that you don't complain about not being able
> > to do "while x = f(): ..." while you're at it. That's also
> > a restriction of the kind you seem to rebel against.
>
> I would have but fortunately the introduction of iterators
> spared you from having to read about that :-)
Exactly, it is the functionality, not syntax that matters.
"if-then-else" vs "then-if-else", does it really matter other than
proving one is "righter" ?

>
> > I'm pretty sure Guido didn't think a bit about *your*
> > memory capacity when he designed Python, but rather wanted
> > to avoid spending his and other programmers' time on helping
> > people with yet another set of silly bugs.
>
> I serious doubt sort's return value of lack thereof made any
> measurable difference in the time spent helping people.
I kind of understand the rationale behind it now, thanks to another
post. I think the argument is that Python is intended for people
without prior programming experience and that the current behaviour is
more "intuitive"(people expect 321321 in the example case), how that
conclusion is drawn I have no idea but could be valid.

The real life situation though is, Python is usually not the first
language one learns and the net result is that one has to unlearn/wash
away what is learnt to appreciate the pythonic way. But that since we
never has a chance of this "from pure to python", we would never
appreciate that as we already know things about mutable/immutable
object. Thereful, we would not make the mistake of expecting "321321"
and thus no chance to appreciate the "oops, what is this not a iterable
error, let me lookup the manual" saga.




More information about the Python-list mailing list