Bill Janssen a écrit : >> Jeffrey, is there any way you can drop the top of the tree and going >> straight from Number to Complex -> Real -> Rational -> Integer? These >> are the things that everyone with high school math will know. > > I think knowledge of the concepts of group, ring, and field is > supposed to be standard knowledge for any high-school senior -- isn't > this what the "new math" was all about?. But they're pretty > fundamental to computer science; anyone trying to do serious work in > the field (that is, anyone with a reason to read the PEP) should have > a nodding acquaintance with them. > > Bill > Even knowing the maths, you still have 2 problems:
1) the number types in Python are pretty much defined by the way CPUs work, not by the math (Decimal beeing the exception), which causes some conceptual impedance mismatch. Discussing to what extend floating point numbers can be compared to theoritical real numbers is a can of worms we probably don't want to open :-) 2) In the PEP, the concepts are used *inconsistently*. Complex derives from Ring because the set of complex numbers *is a* ring. Int derives from Complex because integer are complex numbers (or, alternatively, the set of integers *is included in* the set of complex numbers). The consistent way could be to make the Complex class an instance of Ring, not a subclass. Cheers, BC _______________________________________________ Python-3000 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com
