My own 12 points list

nnes pruebauno at latinmail.com
Mon Aug 25 20:00:47 EDT 2003


I have really no mayor gripes, and the few things I would change would
break backward compatibility, but here is the list anyway:

1.) Eliminate the whole long stuff. E.g. built-in long () function,
"L", etc. It is a Python language implementation detail and I do not
care about how it is done as long as it is fast and correct. Make
python int adapt according to size of the integer and underlying
architecture. 8088-80286=16 bit integers, 386-586=32
bit, x86-64=64bit. If number overflows the CPU architecture
auto-magically use internal (long) representation.

2.) Eliminate map (), filter (), reduce (). It can be replaced with
list comprehensions and for loops, which are easier to read.

3.) Eliminate open (), use file () instead

4.) Eliminate xrange(), replace range() with xrange() implementation

5.) Eliminate built-in functions buffer(), callable(), delattr(),
dir(), getattr(), hasattr(), hash(), help(), id(), isinstance(),
len(), max(), min(), repr(),  setattr(), sum(), str(), type(),
unichr() and make them methods of the root or base object. Transform
them into object.func(parameters). Most of them have as the first
parameter an object anyway. Some of them can be moved to sys. Various
other functions can be deprecated so that I do no have to scan over a
dozen of functions each time I am looking something up. Especially if
few people use them anyway and they can be replaced 1:1 with another
simple construct.

6.) Eliminate lambda, use local ‘def somename(param):return expr'
instead.

7.) Eliminate locals(), globals() and replace with a vars() that
defaults to locals, and accept a parameter to get globals().

8.) Eliminate `x` for repr()

9.) Eliminate raw_input() and replace input() with raw_input()
implementation. Input can be done using eval(input()). Do NOT simply
eliminate input, print and put it in sys. Although it IS ugly, reading
and writing to standard input and output is the bread and butter of
admin scripts, CGI and all kinds of glue programs (python's core
usage) and should be readily available. It also makes for a quick and
dirty user input and output for debugging. sys.stdin.readline() is too
verbose IMHO.

10.) Eliminate the recursion limit on functions or better yet, include
an option to change from the default to infinite. No need to change
anything in the language. A lot of work in the implementation though.
Could use regular method up to a number of calls and then switch to a
less performant method.

11.) Add a big decimal type (something like java) in the standard
library. To be able to do bean counter type math easily. Are there so
few python applications that deal with money?

12.) Int division: return float (for engineers) or big decimal (for
bean counters)

Some of them are blatantly copied from Guidos regrets slides btw. I
just happen to agree with most of the points on them.

Nestor




More information about the Python-list mailing list