User Tools

Site Tools


python_tuples_are_immutable_but_may_change

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
python_tuples_are_immutable_but_may_change [2018/01/18 16:15]
luciano
python_tuples_are_immutable_but_may_change [2018/01/18 16:15] (current)
luciano
Line 135: Line 135:
 As for tuples, make sure they only hold references to immutable objects before trying to use them as dictionary keys or put them in sets. As for tuples, make sure they only hold references to immutable objects before trying to use them as dictionary keys or put them in sets.
  
-{{tag>​python programming_language reference_variables}}+----
  
 > If you like what you just read, please share it! > If you like what you just read, please share it!
Line 141: Line 141:
  
 This post was based on chapter 8 of my book, [[https://​www.amazon.com/​Fluent-Python-Concise-Effective-Programming/​dp/​1491946008|Fluent Python]]. That chapter, titled //Object references, mutability, and recycling// also covers the semantics of function parameter passing, best practices for mutable parameter handling, shallow copies and deep copies, and the concept of weak references — among other topics. The book focuses on Python 3 but most of its content also applies to Python 2.7, like everything in this post. Published originally on the [[http://​radar.oreilly.com/​2014/​10/​python-tuples-immutable-but-potentially-changing.html|O'​Reilly Radar]] blog. This post was based on chapter 8 of my book, [[https://​www.amazon.com/​Fluent-Python-Concise-Effective-Programming/​dp/​1491946008|Fluent Python]]. That chapter, titled //Object references, mutability, and recycling// also covers the semantics of function parameter passing, best practices for mutable parameter handling, shallow copies and deep copies, and the concept of weak references — among other topics. The book focuses on Python 3 but most of its content also applies to Python 2.7, like everything in this post. Published originally on the [[http://​radar.oreilly.com/​2014/​10/​python-tuples-immutable-but-potentially-changing.html|O'​Reilly Radar]] blog.
 +
 +{{tag>​python programming_language reference_variables}}
  
 ~~DISQUS~~ ~~DISQUS~~
  
python_tuples_are_immutable_but_may_change.txt · Last modified: 2018/01/18 16:15 by luciano