Skip to content Skip to sidebar Skip to footer
Showing posts with the label Immutability

Why Don't Tuples Get The Same Id When Assigned The Same Values?

When I executed the following steps, both tuples (a and b) haven't retained their original IDs … Read more Why Don't Tuples Get The Same Id When Assigned The Same Values?

Multiple References In Separate Lists; Python

I'm trying to basically create references to plot multiple relationships and store them in a li… Read more Multiple References In Separate Lists; Python

What Is The Theory Behind Mutable And Immutable Types?

One of the things that I admire about Python is its distinction between mutable and immutable types… Read more What Is The Theory Behind Mutable And Immutable Types?

Why Do Tuples In Python Work With Reversed But Do Not Have __reversed__?

In discussion of this answer we realized that tuples do not have a __reversed__ method. My guess wa… Read more Why Do Tuples In Python Work With Reversed But Do Not Have __reversed__?

Are Tuples In Python Immutable?

It says A tuple can not be changed in any way once it is created. But when I do the following: t… Read more Are Tuples In Python Immutable?

Making A List Subclass Hashable

I want to derive a class from list, add a few instance attributes to it, and make it hashable. What… Read more Making A List Subclass Hashable