Least used builtins?

Lulu of the Lotus-Eaters mertz at gnosis.cx
Fri Jul 4 16:00:28 EDT 2003


|> I haven't used: apply, buffer, coerce, globals, intern, iter, locals,
|> oct, slice, super, unichr, unicode.

Sean 'Shaleh' Perry <shalehperry at comcast.net> wrote previously:
|apply isn't as useful as it used to be.
|locals and globals is useful in some interesting ways.
|iter is really new so no surprise you haven't used it yet.
|most people don't play with octal so I doubt oct() gets a lot of mileage.
|The unicode stuff is new and most English only coders don't use it.

I wouldn't mind moving quite a bit of __builtins__ into standard
modules.  Doing that only creates a one-line incompatibility, i.e. you
might need to add:

    from itertools import enumerate

To the top of a module/script.  Some quick thoughts:

    Current builtin     Possible Home
    ---------------     ---------------
    abs                 math
    apply               functional
    basestring          internal
    bool
    buffer
    callable            sys
    chr
    classmethod         new
    cmp
    coerce
    compile             code
    complex             math
    delattr
    dict
    dir
    divmod              math
    enumerate           itertools
    eval                code
    execfile            code
    file
    filter              functional
    float
    getattr
    globals
    hasattr
    hash                internal
    hex                 math
    id                  internal
    input
    int
    intern              internal
    isinstance          sys
    issubclass          sys
    iter
    len
    list
    locals
    long
    map                 functional
    max                 math
    min                 math
    object              internal
    oct                 math
    open
    ord
    pow                 math
    property            new
    range
    raw_input
    reduce              functinal
    reload
    repr
    round               math
    setattr
    slice
    staticmethod        new
    str
    super               internal
    tuple
    type
    unichr
    unicode
    vars
    xrange              itertools
    zip                 itertools

This sort of thing would cleanup the minimal Python interpreter, while
not deeply hiding/removing anything.

Yours, Lulu...

--
mertz@  | The specter of free information is haunting the `Net!  All the
gnosis  | powers of IP- and crypto-tyranny have entered into an unholy
.cx     | alliance...ideas have nothing to lose but their chains.  Unite
        | against "intellectual property" and anti-privacy regimes!
-------------------------------------------------------------------------






More information about the Python-list mailing list