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

How To Implement "__iadd__()" For An Immutable Type?

I would like to subclass an immutable type or implement one of my own which behaves like an int doe… Read more How To Implement "__iadd__()" For An Immutable Type?

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__?

Is It Possible To Avoid Locking Overhead When Sharing Dicts Between Threads In Python?

I have a multi-threaded application in Python where threads are reading very large (so I cannot cop… Read more Is It Possible To Avoid Locking Overhead When Sharing Dicts Between Threads In Python?

How To Implement "__iadd__()" For An Immutable Type?

I would like to subclass an immutable type or implement one of my own which behaves like an int doe… Read more How To Implement "__iadd__()" For An Immutable Type?