isinstance() bug

Skip Montanaro skip at pobox.com
Thu Jan 29 20:47:44 CET 2004


    Skip> You need to compare inode numbers to see if you have the same or
    Skip> different files.
    ...
    Michs> really a good idea, Skip.

    Jeff> I'd have to come out on the -1 side.

I wasn't necessarily proposing that the current behavior ought to be
changed.  I hadn't considered all the subtle possibilities of such a change,
but in another msg suggested there would be some.

    Jeff> First, because it adds complications to the interpreter simply to
    Jeff> notify a programmer of an avoidable problem that should be caught
    Jeff> by testing.

I suspect some people would disagree with you on this (that it's simply
complicating the interpreter to get rid of an avoidable problem - I don't
know what you meant about "notify a programmer"; I don't envision
notification if such a change were implemented).

    Jeff> Second, I'm not convinced that you won't create some other kind of
    Jeff> problem through cleverness.

Agreed.

    Jeff> Third, I'm not convinced that using inode numbers is guaranteed to
    Jeff> work.  In Unix, it at least needs to be the tuple (inode, device),
    Jeff> because the same inode number can appear on multiple devices.  

Correct.  My mistake.

I agree with you about all the other nasty corner cases.

Skip




More information about the Python-list mailing list