On Thu, Jun 27, 2013 at 1:16 AM, Rotwang <sg...@hotmail.co.uk> wrote: > On 25/06/2013 23:57, Chris Angelico wrote: >> >> On Wed, Jun 26, 2013 at 8:38 AM, Mark Janssen <dreamingforw...@gmail.com> >> wrote: >>> >>> Combining integers with sets I can make >>> a Rational class and have infinite-precision arithmetic, for example. >> >> >> Combining two integers lets you make a Rational. Python integers are >> >> already infinite-precision. Or are you actually talking of using >> "machine words" and sets as your fundamental? Also, you need an >> >> ordered set - is the set {5,3} greater or less than the set {2} when >> you interpret them as rationals? One must assume, I suppose, that any >> >> one-element set represents the integer 1, because any number divided >> by itself is 1. Is the first operand 3/5 or 5/3? > > > You could use Kuratowski ordered pairs: > > http://en.wikipedia.org/wiki/Ordered_pair#Kuratowski_definition > > Not that doing so would be sensible, of course. I don't know much about > low-level data structures but it seems obvious that it's much easier to > implement an ordered container type than an unordered set on a computer.
Yeah, I don't think Mark is much concerned about implementing things on actual computers, somehow :) ChrisA -- http://mail.python.org/mailman/listinfo/python-list