[Python-ideas] Minimal built-ins (+ tiny doc suggestion)

Steven D'Aprano steve at pearwood.info
Fri May 25 11:07:03 CEST 2012


Mark Summerfield wrote:
> Hi,
> 
> Built-ins:
> 
> In an effort to keep the core language as small as possible (to keep it
> "brain sized":-) would it be reasonable to deprecate filter() and map()
> and to move them to the standard library as happened with reduce()?
> After all, don't people mostly use list comprehensions and generator
> expressions for these nowadays?

So you would put people through the pain of dealing with broken code and 
deprecation just so that people don't have to remember functions which you 
think they don't remember anyway?

-1

Keeping the core language small is a benefit to core developers. It is not so 
much a benefit to users of the language -- if a programmer is only using the 
builtins, they are surely reinventing the wheel (and probably badly). To be an 
effective programmer, you surely are using functions and classes in the std 
lib as well as the builtins, which means you have to memorise both what the 
function is, *and* where it is. Shrinking the builtins while increasing the 
size of the std lib is not much of a human-memory optimization, and may very 
well be a pessimation.

If you need a memory-jog, it is much easier to find builtins because they are 
always available to a quick call to dir(), while finding something in a module 
means searching the docs or the file system.


-- 
Steven



More information about the Python-ideas mailing list