<jupyter_start><jupyter_text>SetsAlways use the literal expression. It's faster than the constructor **Faster**<jupyter_code>s = {1, 2}<jupyter_output><empty_output><jupyter_text>**Slower**<jupyter_code>s = set([1,2])<jupyter_output><empty_output><jupyter_text>**Empty set**Do not use the literal expression. Use a the constructor with empty arguments<jupyter_code>s = set()
s<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1330049261083744, 'fraction_numerical': 0.009852216748768473, 'mean_word_length': 10.970588235294118, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '268395', 'license': 'MIT', 'n_tokens_mistral': 153, 'n_tokens_neox': 148, 'n_words': 29, 'path': 'python_native/01_collections/sets_and_dictionaries.ipynb', 'repo_name': 'murdockcrc/python-tricks', 'size': '406'}