Use cases for del
reinhold-birkenfeld-nospam at wolke7.net
Sun Jul 10 04:49:36 EDT 2005
Ron Adam wrote:
>> >>> 'abc' is 'abcd'[:3]
> Well of course it will be false... your testing two different strings!
> And the resulting slice creates a third.
> ABC = 'abc'
> value = ABC
> if value is ABC: # Test if it is the same object
That's not going to buy you any time above the "is None", because identity-
testing has nothing to do with the type of the object.
Additionally, using "is" with immutable objects is horrible.
More information about the Python-list