Identity inconsistency and unification of types and classes

R

Rim

Hi,

With the great unification of types and classes, what will happen to the
following identity inconsistency?
0

Thanks
- Rim
 
E

Erik Max Francis

Rim said:
With the great unification of types and classes, what will happen to
the
following identity inconsistency?

0

Whether or not int(1) is int(1) is purely an optimization issue, so one
wonders why one would be concerned about it.
 
M

Michael Hudson

Hi,

With the great unification of types and classes, what will happen to the
following identity inconsistency?

0

Nothing, as is. You can always dick about in myint.__new__ if you
really want to manage that, but as others keep saying, you shouldn't
worry about it too much.

Cheers,
M.
 
M

Moshe Zadka

With the great unification of types and classes, what will happen to the
following identity inconsistency?

0

Nothing, as is. You can always dick about in myint.__new__ if you
really want to manage that, but as others keep saying, you shouldn't
worry about it too much.

Of course, the inconsistency has always been present:
0

Not so much with the consistency, huh?
Here's the deal: if a,b are immutable builtin objects, and a==b, it is
undefined if "a is b" is true. Do not rely on it. Assume patch releases
of Python will change it to be randomly true or false. Assume flags
to Python's compilation will randomly change it to true or false. Assume
the fluttering of the wings of a butterfly in Tibet will create a storm...
err, sorry, got carried away there.

Exercise: Determine for yourself where exactly I got carried away. Discuss.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,832
Latest member
GlennSmall

Latest Threads

Top