<jupyter_start><jupyter_text>Shared References and Mutabilityshared reference: two variables referencing the same object in memory(same memory address)The Python memory manager may create a shared reference on immutable objectssuch as:<jupyter_code>a = 10
b = 10
id(a)
id(b)<jupyter_output><empty_output><jupyter_text>The variables, a and b, will point to same memory location (Python internals).The Python memory manager will not create a shared reference on mutable objects,each will point to its own object in memory.<jupyter_code>a = [10]
b = [10]
id(a)
id(b)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.07588532883642496, 'fraction_numerical': 0.013490725126475547, 'mean_word_length': 6.92, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '316469', 'license': 'MIT', 'n_tokens_mistral': 190, 'n_tokens_neox': 178, 'n_words': 69, 'path': 'python-deepdive/deepdive1/section03/section_03_22.ipynb', 'repo_name': 'erictapia/devstacklab', 'size': '593'}