int/long unification hides bugs

Alex Martelli aleaxit at yahoo.com
Wed Oct 27 02:48:41 EDT 2004


kartik <kartick_vaddadi at yahoo.com> wrote:

> aleaxit at yahoo.com (Alex Martelli) wrote in message
news:<1gm9a9j.s0b279yqpnlvN%aleaxit at yahoo.com>...
> > Cliff Wells <clifford.wells at comcast.net> wrote:
> 
> > optional constraint checking [...] can be a handy feature for many kinds
> > of applications [...] Of course, this has nothing to do with silly and
> > arbitrary bounds such as 2**31-1.
> 
> bounds such as 2**31 are a crude form of constraint checking that you
> get by default. if you feel your data is going to be larger, you can
> use a long type

Too crude to be any real use, and wrong-headed _as a default_.
Constraints should apply _when explicitly requested_, with the default
always being "unconstrained".  (It's a wart in Python that we don't get
that with recursion, for example; it forces people to look for
non-recursive solutions, where recursive ones are simpler and smoother,
because it robs recursive approaches of some generality).


Alex



More information about the Python-list mailing list