Chris Angelico rosuav at
Thu Mar 6 01:50:10 CET 2014

On Thu, Mar 6, 2014 at 11:35 AM, Steven D'Aprano
<steve+comp.lang.python at> wrote:
> On Thu, 06 Mar 2014 08:26:22 +1100, Chris Angelico wrote:
>> Where's the complaints about circularity now? You're saying "But of
>> course id() returns the address, as long as we define the address as
>> 'whatever id() returns'.". Unimpeachably logical and utterly unhelpful.
> That last sentence is wrong. There is nothing logical about just making
> up arbitrary definitions in this way. He could invent *any* definition,
> each more ridiculous than the last:

I mean logical in the sense of pure logic.

If all spam is edible-food
And if this-can is spam
Then this-can is edible-food

The opening premise is false (I wouldn't want to eat a punctured can
that's been sitting around for a few months), but it's still perfectly
logical. The conclusion is guaranteed to be true as long as the
premises are.

In that sense of the word, the statement is indeed logical. That
doesn't stop it from being wrong, but it is logical.

If the 'is' comparison is reflexive,
And if three is four,
Then four is three.

Perfectly logical.

He's saying that the address of an object is simply "whatever id()
returns for that object". Since Python doesn't currently have any
other concept of object addresses, that definition isn't in conflict
with anything. Then he says, look! the id() function returns the
object's address. Well, duh, that's how you defined the address. It's
logical. Of course it returns "the address", since "the address" has
been defined as what it returns. But it doesn't achieve anything to
prove that.


More information about the Python-list mailing list