[Baypiggies] Baypiggies snippets

Chad Netzer chad.netzer at gmail.com
Tue Mar 27 08:30:06 CEST 2007


On 3/26/07, Keith Dart ♂ <keith at dartworks.biz> wrote:
>
> OK, I see your point.  But it can be managed... Better still would be to
> have a single point of contact that would mediate "official" additions
> to __builtins__. Something similar to how the IANA manages Internet
> assigned numbers and other common data. Should we create a central
> control point where a developer can request a built-in name and
> function (and check for existing ones)?

Well, for something REALLY useful, bring it up on the developers list,
and if it gets positive feedback, make a PEP (if Guido really takes a
shine to it, it may skip the PEP).  It generally has to be something
special, though (ie. really basically useful).

sum() got added, a few years back, based on a thread by A. Martelli
and quite a few others, and I'm sure there are some similar examples
with other new builtins.  Basically, there are channels, as it usually
(always?) involves the new builtin being implemented in C, and thus
supported by the Python language developers.

But, otherwise, I'm not sure what problem is solved by various
libraries adding things to _builtins_.  Since they can't be depended
on to be there, you still need to have the extra libraries.  And once
you've got those libraries, it is easy to import things into your
module's namespace with:

from blech import bleh

Frankly, I'd be rather ticked off if:

import arbitrary_module

were to change the _builtins_  (which is what I assume we are talking
about?).  But, if I've missed the point, enlighten me.  I do wish to
know.

At the very least, if you feel you have a bunch of cool functions, put
them in a separate module (or sub-package) so that others can:

from some_cool_functions_module import *

if they wish...

Chad


More information about the Baypiggies mailing list