bug or feature in enum34 py2.7 backport?

Terry Reedy tjreedy at udel.edu
Wed Nov 26 16:16:21 EST 2014


On 11/26/2014 10:32 AM, random832 at fastmail.us wrote:

> It seems like if it is a bug to reject long where int is accepted,

I do not believe that is universally true is 2.7.  But even if it is...
Short ints were, value-wise, a subset of longs.  Thus, for example, 
binary operations could always convert the int to long and continue.  In 
3.0, short ints were removed and long renamed int.

> should be likewise considered a bug to reject ASCII-only unicode where
> str is accepted.

That would require an O(n) check.  Bytes and unicode have an ascii 
overlap when bytes are interpreted as ascii chars, but neither is a 
subset of the other.  Mixed binary operations were removed in 3.x.

-- 
Terry Jan Reedy




More information about the Python-list mailing list