Philosophical long integer question...

Brian Kelley kelley at
Fri Mar 31 13:41:52 CEST 2000

Ralf Muschall wrote:

> Brian Kelley wrote:
> > should (1 << 1000) produce a long int?  (It currently produces 0 on a
> IMHO it should if and only if everything else promotes as
> well. In that case, it would be nice to have standard types
> (e.g. classes that come with the libs) like int8, int16,
> int32, int64, uint8, ... which behave like their names
> indicate (e.g. for hacking crypto stuff).
> Ralf

I hadn't thought about this approach.  Currently python will not promote
unless forced.  What if the procedure was reversed?  Promote unless
explicitly told not to promote.  So (1 << 1000) will promote but (int32(1)
<< 1000) won't (or whatever you want to specify 'normal' integers with)  Is
this what you mean?

Half of my brain likes this, the other half doesn't.  The questions are
what forms are used the most often and how this would affect users (it
certainly would affect a lot of code...)

Brian Kelley          (505) 982-7884 ext 207
Bioreason, Inc        kelley at
105 Washington #303, Santa Fe NM, 87501

More information about the Python-list mailing list