The language vs. the environment
Raymond Hettinger
python at rcn.com
Thu Mar 7 01:24:15 EST 2002
"Skip Montanaro" <skip at pobox.com> wrote in message
news:mailman.1015449438.31833.python-list at python.org...
>
> There has been a huge amount of recent PEP activity related to further
> enhancements to the language. I think in general that if more of this
> energy was directed at the overall environment (library, support tools,
> installers, documentation, etc) we'd be better off in the long run.
I certainly agree that effort needs to be put into the library, etc.
However, I would like to defend the PEP writers guild on a few points:
1. Writing a PEP is a disciplined activity that involves completely
thinking our design choices, rallying public opinion, collecting
all points of view for and against, and documenting all of that
information in a single, version controlled, standard format
document in a public place for everyone to study, ridicule,
or on extremely rare occassions, adopt.
In other words, PEP writing is contributing to science and is
not a wasted effort even if the idea never gets adopted.
While some people groan whenever a new PEP appears, I think
it's a good sign, rather than bad. It means we have smart people
who care and are willing to engage in public collaboration instead
of sitting on the sides slinging mud like other language forums (not
to mention any one particular four letter scripting language).
2. Having several PEPs relating to loop counters suggests that either
we're all nuts or that maybe this is a constant source of irritation
and that any one of the proposals may be fixing a real problem.
Note, the two options are not mutually exclusive; perhaps, we're
all nuts AND Python needs a loop counter solution.
My own recommendation is not entirely over top:
indexed( collection, start=0, limit=None )
One built-in function to improve readability and reliability while
solving the problem forever. Returning a generator is a low
over-head, lazy solution compared to PEP 212 creating a huge
new list of tuples. The real question is why there is so much
inertia on getting this one solved.
Please excuse the diatribe. Now that's out of my system, here are
are few random thoughts on the PEPs:
237 Unifying longs and shorts -- I sure hope this gets finished
for 2.3. It is long overdue (no pun intended)
246 Object Adaptation -- This has the potential to be a profound
improvement while not getting in the way of people who
don't need it.
265 Sorting Dictionaries by Value -- I don't think the world would
come to an end if this were adopted. It's kinda nice, very
easy to implement, and is invisible to people who don't need it.
What's all the fuss about? Let's just do it.
266, 267 -- Optimized Python good. Slow Python bad.
269 Pgen module -- I see the upside. Is there a downside?
270 Uniq method for list objects -- Same comment as for 265
274 Dictionary comprehensions -- Sounds cool but is not a compelling
advantage over dict( [(k,f(v) for k in alist] ). Hey, it only saves
fewer than ten characters and no lines.
275 Switching on Multiple Values -- Wouldn't be surprised if someone
told me this optimization were already in place. Which Pythonista
is going to stand-up and demand that we keep a slower implementation'
just because he or she hates the concept of change.
279 Enhanced Generators (my PEP) -- indexed() is WAY cool -- let's do it.
Okay, the x-functions may belong in a separate module. Generator
Comprehensions are loved by more than few, are trivially easy to
implement,
and invisible to those who don't care for them. And about .next(arg)
and
.throw(exception) -- yawn.
212, 276, 279(indexed), 281, and 284. Any of the above, all of the above,
pick one and solve a real problem.
My overall point is that it would be unhealthy to adopt an anti-pep attitude
and that many of the PEPs are darned useful and not at all hurtful.
This point may not apply to you. When I wrote 279, some replies were
supportive,
some were inquisitive, some were analytical, some were helpful, but there
were
some that had a scary attitude along the lines of:
"I don't care if the idea is good,
I will fight further changes till my dying breath"
That being said, Skip is right. The libraries, documentation, and patches
need work. I did not miss his point.
G' nite,
Raymond Hettinger
More information about the Python-list
mailing list