[Tutor] object size in python is in what units?

Marc Tompkins marc.tompkins at gmail.com
Tue Jul 23 10:24:23 CEST 2013


On Tue, Jul 23, 2013 at 1:17 AM, Jim Mooney <cybervigilante at gmail.com>wrote:

> On 23 July 2013 00:40, Steven D'Aprano <steve at pearwood.info> wrote:
>
>>
>> No no no, a thousand times no!!! IDs are just numeric IDs, that is all,
>> like your social security number or driver's licence number. Don't think of
>> them as having any meaning at all, except that they are unique during the
>> lifetime of the object.
>>
>
> Okay, ID stands for a location fixed until the object disappears, but we
> don't know where that location is. But what about object offsets from self?
> Is the beginning of self.spam always the same distance from the beginning
> of self.eggs? Or can I just forget the hard ground of assembler-metaphors
> entirely as I float off into abstractville? I guess the fixed lengths I
> kept getting on re-runs were coincidental but not to be relied on.
>

As Steven said: they are NOT locations, they are IDs.  There is no distance
involved.  You CAN find the size of an object, and you can find its
location in memory (but you really shouldn't bother, or rely on it) but
neither of those things has any particular relation to the ID, except
accidentally.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20130723/10f791fe/attachment.html>


More information about the Tutor mailing list