<commit_before>'''
Created on Jul 1, 2014

@author: viejoemer
'''
############################################################
#Difference between dict.clear() and assigning {} in Python?

#Creating a dict with data

d = {
     "red":100,
     "yellow":200,
     "blue" : 300
     }

#Reference to the same dict 

d_clone = d

print(d_clone)
print(d)

#Cleaning the dict

d.clear()

#This clean both of them.
print(d_clone)
print(d)

############################################################
d = {
     "red":100,
     "yellow":200,
     "blue" : 300
     }

#if you use {} to "clean" a dict, this gonna create a new one.
#and the other keep the values.

d_clone = d

d = {}

print(d_clone)

print(d)

print(d)<commit_msg>Difference between dict.clear() and assigning {} in Python?<commit_after>'''
Created on Jul 2, 2014

@author: viejoemer

Difference between dict.clear() and assigning {} in Python?

¿Diferencia entre dict.clear () y asignar {} en Python?

'''

#Creating a dict with data
d = {
     "red":100,
     "yellow":200,
     "blue" : 300
     }

#Reference to the same dict 
d_clone = d
print(d_clone)
print(d)

#Cleaning the dict
d.clear()

#This clean both of them.
print(d_clone)
print(d)

d = {
     "red":100,
     "yellow":200,
     "blue" : 300
     }

#if you use {} to "clean" a dict, this gonna create a new one.
#and the other keep the values.
d_clone = d
d = {}
print(d_clone)
print(d)
{'fraction_non_alphanumeric': 0.20933521923620935, 'fraction_numerical': 0.03253182461103253, 'mean_word_length': 3.4778481012658227, 'pattern_counts': {'":': 8, '<': 3, '<?xml version=': 0, '>': 3, '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}}
{'dir': 'git-commits-cleaned', 'id': '7346550', 'n_tokens_mistral': 544, 'n_tokens_neox': 491, 'n_words': 163}