On Sat, Jul 16, 2016 at 4:53 PM, Random832 <random...@fastmail.com> wrote: > On Sat, Jul 16, 2016, at 02:29, Chris Angelico wrote: >> The difference between ints and floats can lead to bugs, too. Which >> one should we eliminate? > > Eliminate both of them. Move to a single abstract numeric type* a la > Scheme, with an "inexact" attribute (inexact numbers may or may not be > represented by a float, or by the same bigint/decimal/rational types as > exact ones with a flag set to mark them as inexact.) > > *which may have multiple concrete representations, just as our single > abstract unicode string type has different concrete representations for > ASCII, Latin-1, UCS-2, and UCS-4.
Thing is, a Unicode string could be represented in exactly one way (UCS-4), with identical semantics. Look at Py2's "wide build" (eg most Linux builds). The rest is just optimization. With a single abstract numeric type, what exactly does "inexact" mean, where does it come from, and how does that affect the expected behaviour and performance of numbers? Will an "Exact" non-integer be stored as Decimal or Fraction? How do you know? They have vastly different semantics, and you should be able to choose. ChrisA -- https://mail.python.org/mailman/listinfo/python-list