Everything is an object in python - object class and type class

Jon Ribbens jon+usenet at unequivocal.co.uk
Tue Jun 2 15:31:23 EDT 2015


On 2015-06-02, Dr. Bigcock <dreamingforward at gmail.com> wrote:
> On Tuesday, June 2, 2015 at 1:49:03 PM UTC-5, Jon Ribbens wrote:
>> On 2015-06-02, Dr. Bigcock <dreamingforward at gmail.com> wrote:
>> > It doesn't really do anything.  No one uses integers as objects.
>> > (Any dissenters?)
>> 
>> Yes. *Everyone* uses integers as objects. Containers such as
>> lists and dictionaries and tuples etc contain objects. If
>> integers weren't objects then you wouldn't be able to put them
>> in containers (and you'd end up with Java).
>
> Sorry.  I meant "object" in the sense of OOP:  something you might
> extend or make a derived class with.

I'm not sure you get to define which properties of objects you want
not to count.

> Your last claim, must not be true because integers were able to be
> placed in objects before the type/class unification with v2.6, I
> believe.

Unless I'm misremembering, before that they were still objects,
just not quite the same kind of objects as pure-Python ones.



More information about the Python-list mailing list