What is the semantics meaning of 'object'?

Ian Kelly ian.g.kelly at gmail.com
Tue Jun 25 19:10:25 EDT 2013


On Tue, Jun 25, 2013 at 5:07 PM, Ian Kelly <ian.g.kelly at gmail.com> wrote:
> On Tue, Jun 25, 2013 at 4:38 PM, Mark Janssen <dreamingforward at gmail.com> wrote:
>> The issue of classes cooperating isn't as big as it seems, because
>> since you're working now from a useful, agreed-upon common base (the
>> non-negotiable, but also non-arbitrary) machine types, you're now all
>> (the python and ideally the *object* community) speaking the same
>> language.   Who's going to argue about integers (as the atomic type)
>> and sets (as the most basic grouping type) being THE common set of
>> bases for everything else?  I mean, it doesn't get anymore ideal and
>> pure than integers and sets.  Combining integers with sets I can make
>> a Rational class and have infinite-precision arithmetic, for example.
>
> I don't see how this solves anything.  At some point you have to be
> able to add methods and attributes to your objects.  For example, your
> Rational class is going to need some sort of "reduce" method to reduce
> a Rational instance to lowest terms.  That's not a method that belongs
> on an integer or set type.  If you can't add functionality, then all
> you will ever have are integers and sets, and if you can add
> functionality, then what difference does it make what your fundamental
> base class is?

Oh, and just in case you're not aware, Python already has a Fraction
class that supports unlimited-precision arithmetic.  It doesn't need
to inherit from tuple to accomplish this, and in fact that would be a
bad way to approach it, since a fraction is *not* a tuple.



More information about the Python-list mailing list