{"id":11137,"date":"2021-05-15T11:16:30","date_gmt":"2021-05-15T05:46:30","guid":{"rendered":"http:\/\/www.pythonpool.com\/?p=11137"},"modified":"2026-07-13T12:33:48","modified_gmt":"2026-07-13T07:03:48","slug":"convert-list-to-set-python","status":"publish","type":"post","link":"https:\/\/www.pythonpool.com\/convert-list-to-set-python\/","title":{"rendered":"Convert a List to a Set in Python: Duplicates and Order"},"content":{"rendered":"<p><strong>Quick answer:<\/strong> Convert a list with set(items) when you need unique hashable values and do not need the input order. If stable order matters, dict.fromkeys(items) removes duplicates while preserving the first occurrence.<\/p>\n<figure class=\"pythonpool-article-visual\"><img src=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/convert-list-to-set-python.png\" alt=\"Python Pool infographic comparing list to set conversion duplicates order hashability and stable deduplication\" width=\"1536\" height=\"1024\" loading=\"lazy\" decoding=\"async\"><figcaption>A set removes duplicate hashable values, but conversion changes ordering and cannot accept unhashable list members.<\/figcaption><\/figure>\n<p>To convert a list to a set in Python, pass the list to <code>set()<\/code>. This removes duplicate values and returns a set of unique hashable items.<\/p>\n<p>Use this when order does not matter and you need fast membership checks or unique values. If order matters, use <code>dict.fromkeys()<\/code> and convert the keys back to a list.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_85 counter-hierarchy ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #990303;color:#990303\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #990303;color:#990303\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.pythonpool.com\/convert-list-to-set-python\/#Quick_Answer\" >Quick Answer<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.pythonpool.com\/convert-list-to-set-python\/#Convert_a_List_to_a_Set\" >Convert a List to a Set<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.pythonpool.com\/convert-list-to-set-python\/#Convert_Back_to_a_List\" >Convert Back to a List<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.pythonpool.com\/convert-list-to-set-python\/#Remove_Duplicates_and_Preserve_Order\" >Remove Duplicates and Preserve Order<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.pythonpool.com\/convert-list-to-set-python\/#Convert_a_List_of_Strings_to_a_Set\" >Convert a List of Strings to a Set<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.pythonpool.com\/convert-list-to-set-python\/#Handle_Unhashable_Values\" >Handle Unhashable Values<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.pythonpool.com\/convert-list-to-set-python\/#Use_Sets_for_Membership_Tests\" >Use Sets for Membership Tests<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.pythonpool.com\/convert-list-to-set-python\/#Sort_Unique_Values_When_Output_Order_Matters\" >Sort Unique Values When Output Order Matters<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.pythonpool.com\/convert-list-to-set-python\/#When_Not_to_Convert_to_a_Set\" >When Not to Convert to a Set<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.pythonpool.com\/convert-list-to-set-python\/#Common_Mistakes\" >Common Mistakes<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.pythonpool.com\/convert-list-to-set-python\/#FAQs\" >FAQs<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/www.pythonpool.com\/convert-list-to-set-python\/#How_do_I_convert_a_list_to_a_set_in_Python\" >How do I convert a list to a set in Python?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/www.pythonpool.com\/convert-list-to-set-python\/#Does_converting_a_list_to_a_set_preserve_order\" >Does converting a list to a set preserve order?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/www.pythonpool.com\/convert-list-to-set-python\/#Why_do_I_get_unhashable_type_list\" >Why do I get unhashable type: list?<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/www.pythonpool.com\/convert-list-to-set-python\/#Convert_A_List_To_A_Set\" >Convert A List To A Set<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/www.pythonpool.com\/convert-list-to-set-python\/#Preserve_Input_Order\" >Preserve Input Order<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/www.pythonpool.com\/convert-list-to-set-python\/#Handle_Unhashable_Members\" >Handle Unhashable Members<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/www.pythonpool.com\/convert-list-to-set-python\/#Choose_The_Collection\" >Choose The Collection<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/www.pythonpool.com\/convert-list-to-set-python\/#Frequently_Asked_Questions\" >Frequently Asked Questions<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-20\" href=\"https:\/\/www.pythonpool.com\/convert-list-to-set-python\/#How_do_I_convert_a_list_to_a_set_in_Python-2\" >How do I convert a list to a set in Python?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-21\" href=\"https:\/\/www.pythonpool.com\/convert-list-to-set-python\/#Does_converting_a_list_to_a_set_preserve_order-2\" >Does converting a list to a set preserve order?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-22\" href=\"https:\/\/www.pythonpool.com\/convert-list-to-set-python\/#Why_does_converting_a_list_to_a_set_raise_TypeError\" >Why does converting a list to a set raise TypeError?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-23\" href=\"https:\/\/www.pythonpool.com\/convert-list-to-set-python\/#How_do_I_convert_a_set_back_to_a_list\" >How do I convert a set back to a list?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Quick_Answer\"><\/span>Quick Answer<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Use <code>set(my_list)<\/code> for the simplest conversion. Python documents sets in the official <a href=\"https:\/\/docs.python.org\/3\/library\/stdtypes.html#set-types-set-frozenset\">set types<\/a> reference and in the tutorial section on <a href=\"https:\/\/docs.python.org\/3\/tutorial\/datastructures.html#sets\">sets<\/a>.<\/p>\n<div class=\"pythonpool-code-scroll\" style=\"max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;\">\n<pre><code class=\"language-python\">numbers = [3, 1, 3, 2, 1]\nunique_numbers = set(numbers)\n\nprint(unique_numbers)\n<\/code><\/pre>\n<\/div>\n<p>The result contains each value once. The display order of a set is not something your code should rely on.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Convert_a_List_to_a_Set\"><\/span>Convert a List to a Set<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>A list can contain duplicate values, while a set keeps only unique values. Python&#8217;s standard docs describe <a href=\"https:\/\/docs.python.org\/3\/library\/stdtypes.html#lists\">lists<\/a> as mutable sequences.<\/p>\n<div class=\"pythonpool-code-scroll\" style=\"max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;\">\n<pre><code class=\"language-python\">items = [\"red\", \"blue\", \"red\", \"green\"]\nunique_items = set(items)\n\nprint(unique_items)\nprint(\"red\" in unique_items)\n<\/code><\/pre>\n<\/div>\n<p>Sets are useful when you repeatedly check whether a value exists. Membership checks in a set are usually clearer and faster than scanning a long list.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Convert_Back_to_a_List\"><\/span>Convert Back to a List<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>If later code needs a list, wrap the set with <code>list()<\/code>. This gives you unique values, but not the original order.<\/p>\n<div class=\"pythonpool-code-scroll\" style=\"max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;\">\n<pre><code class=\"language-python\">numbers = [5, 2, 5, 1, 2]\nunique_list = list(set(numbers))\n\nprint(unique_list)\n<\/code><\/pre>\n<\/div>\n<p>Use this only when order is irrelevant. If order matters, use the next pattern instead.<\/p>\n<p><!-- Python Pool visual layout repair 2026-07-13 --><\/p>\n<figure class=\"pythonpool-article-visual pythonpool-supporting-visual\"><img src=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/list-to-set-list-b130.png\" alt=\"Python Pool infographic showing a list with order, duplicates, values, and iterable input\" width=\"1536\" height=\"1054\" loading=\"lazy\" decoding=\"async\"><figcaption>List input: A list with order, duplicates, values, and iterable input.<\/figcaption><\/figure>\n<h2><span class=\"ez-toc-section\" id=\"Remove_Duplicates_and_Preserve_Order\"><\/span>Remove Duplicates and Preserve Order<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>To remove duplicates while preserving first-seen order, use <code>dict.fromkeys()<\/code>. Python documents <a href=\"https:\/\/docs.python.org\/3\/library\/stdtypes.html#dict.fromkeys\">dict.fromkeys()<\/a>, and dictionaries are covered in the tutorial section on <a href=\"https:\/\/docs.python.org\/3\/tutorial\/datastructures.html#dictionaries\">dictionaries<\/a>.<\/p>\n<div class=\"pythonpool-code-scroll\" style=\"max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;\">\n<pre><code class=\"language-python\">numbers = [5, 2, 5, 1, 2]\nunique_in_order = list(dict.fromkeys(numbers))\n\nprint(unique_in_order)\n<\/code><\/pre>\n<\/div>\n<p>This returns <code>[5, 2, 1]<\/code>. It is often the best method for user-facing lists where the first occurrence should stay in place.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Convert_a_List_of_Strings_to_a_Set\"><\/span>Convert a List of Strings to a Set<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>String values work well in sets because strings are hashable. Normalize case first if <code>\"Python\"<\/code> and <code>\"python\"<\/code> should be treated as the same value.<\/p>\n<div class=\"pythonpool-code-scroll\" style=\"max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;\">\n<pre><code class=\"language-python\">tags = [\"Python\", \"python\", \"SEO\", \"seo\"]\nunique_tags = {tag.lower() for tag in tags}\n\nprint(unique_tags)\n<\/code><\/pre>\n<\/div>\n<p>For related cleanup, see PythonPool&#8217;s <a href=\"https:\/\/www.pythonpool.com\/python-lowercase\/\">Python lowercase<\/a>, <a href=\"https:\/\/www.pythonpool.com\/python-remove-newline-from-list\/\">remove newline from list<\/a>, and <a href=\"https:\/\/www.pythonpool.com\/python-count-words-in-string\/\">count words in a string<\/a> guides.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Handle_Unhashable_Values\"><\/span>Handle Unhashable Values<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Only hashable values can go into a set. Numbers, strings, and tuples are usually fine. Lists and dictionaries are mutable, so they are not hashable.<\/p>\n<div class=\"pythonpool-code-scroll\" style=\"max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;\">\n<pre><code class=\"language-python\">rows = [[\"Ada\", 1], [\"Ada\", 1], [\"Grace\", 2]]\nunique_rows = {tuple(row) for row in rows}\n\nprint(unique_rows)\n<\/code><\/pre>\n<\/div>\n<p>Convert inner lists to tuples when the row content should become set items. For nested mapping work, see PythonPool&#8217;s <a href=\"https:\/\/www.pythonpool.com\/nested-dictionary-python\/\">nested dictionary<\/a> guide.<\/p>\n<figure class=\"pythonpool-article-visual pythonpool-supporting-visual\"><img src=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/list-to-set-set-b130.png\" alt=\"Python Pool infographic showing a Python set with unique hashable values and membership\" width=\"1536\" height=\"1054\" loading=\"lazy\" decoding=\"async\"><figcaption>Set output: A Python set with unique hashable values and membership.<\/figcaption><\/figure>\n<h2><span class=\"ez-toc-section\" id=\"Use_Sets_for_Membership_Tests\"><\/span>Use Sets for Membership Tests<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Sometimes you do not need to convert the set back to a list. Keep it as a set when the main job is lookup.<\/p>\n<div class=\"pythonpool-code-scroll\" style=\"max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;\">\n<pre><code class=\"language-python\">allowed = set([\"read\", \"write\", \"delete\"])\n\nprint(\"write\" in allowed)\nprint(\"admin\" in allowed)\n<\/code><\/pre>\n<\/div>\n<p>This pattern is common for permissions, filters, known IDs, and validation lists. If you need to copy or mutate lists before conversion, PythonPool&#8217;s <a href=\"https:\/\/www.pythonpool.com\/python-copy-list\/\">copy list<\/a>, <a href=\"https:\/\/www.pythonpool.com\/python-list-pop\/\">list pop()<\/a>, and <a href=\"https:\/\/www.pythonpool.com\/python-dynamic-array\/\">dynamic array<\/a> guides are useful follow-ups.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Sort_Unique_Values_When_Output_Order_Matters\"><\/span>Sort Unique Values When Output Order Matters<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>If you want unique values in sorted order, convert to a set and then call <code>sorted()<\/code>. This returns a list.<\/p>\n<div class=\"pythonpool-code-scroll\" style=\"max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;\">\n<pre><code class=\"language-python\">numbers = [4, 1, 4, 3, 1, 2]\nunique_sorted = sorted(set(numbers))\n\nprint(unique_sorted)\n<\/code><\/pre>\n<\/div>\n<p>For dictionary sorting patterns, see PythonPool&#8217;s <a href=\"https:\/\/www.pythonpool.com\/sort-dictionary-by-key-in-python\/\">sort dictionary by key<\/a> article. For size and memory context, read <a href=\"https:\/\/www.pythonpool.com\/python-dictionary-size\/\">dictionary size<\/a>.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"When_Not_to_Convert_to_a_Set\"><\/span>When Not to Convert to a Set<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Do not convert a list to a set when duplicate counts matter, when the original order is part of the meaning, or when the list contains unhashable nested values that should remain mutable. A set is a uniqueness tool, not a drop-in replacement for every list.<\/p>\n<p>If you need duplicate counts, use a counting approach instead of a set. If you need a unique list in a stable order, <code>dict.fromkeys()<\/code> is usually safer than <code>list(set(values))<\/code>.<\/p>\n<figure class=\"pythonpool-article-visual pythonpool-supporting-visual\"><img src=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/list-to-set-order-b130.png\" alt=\"Python Pool infographic comparing set conversion, sorting, insertion order, and a stable list\" width=\"1536\" height=\"1054\" loading=\"lazy\" decoding=\"async\"><figcaption>Order loss: Set conversion, sorting, insertion order, and a stable list.<\/figcaption><\/figure>\n<h2><span class=\"ez-toc-section\" id=\"Common_Mistakes\"><\/span>Common Mistakes<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li>Expecting a set to preserve the original list order.<\/li>\n<li>Trying to put lists or dictionaries directly inside a set.<\/li>\n<li>Using a set when duplicate counts are important.<\/li>\n<li>Converting back to a list and assuming the result is sorted.<\/li>\n<li>Forgetting that <code>True<\/code> and <code>1<\/code> compare as equal in a set.<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"FAQs\"><\/span>FAQs<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"How_do_I_convert_a_list_to_a_set_in_Python\"><\/span>How do I convert a list to a set in Python?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Use <code>set(my_list)<\/code>. It returns a set containing unique values from the list.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Does_converting_a_list_to_a_set_preserve_order\"><\/span>Does converting a list to a set preserve order?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>No. Use <code>list(dict.fromkeys(my_list))<\/code> when you need unique values in first-seen order.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Why_do_I_get_unhashable_type_list\"><\/span>Why do I get unhashable type: list?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>A set can only contain hashable values. Convert inner lists to tuples, or choose a different data structure.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Convert_A_List_To_A_Set\"><\/span>Convert A List To A Set<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>A set is built from an iterable and keeps one copy of each hashable value. It is useful for membership tests and duplicate removal, but the result should not be treated as a sorted or original-order collection.<\/p>\n<div class=\"pythonpool-code-scroll\" style=\"max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;\">\n<pre><code class=\"language-python\">items = [\"red\", \"blue\", \"red\", \"green\"]\nunique = set(items)\nprint(unique)\nprint(\"blue\" in unique)<\/code><\/pre>\n<\/div>\n<figure class=\"pythonpool-article-visual pythonpool-supporting-visual\"><img src=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/list-to-set-check-b130.png\" alt=\"Python Pool infographic testing unhashable values, empty input, duplicates, and results\" width=\"1536\" height=\"1054\" loading=\"lazy\" decoding=\"async\"><figcaption>Conversion checks: Unhashable values, empty input, duplicates, and results.<\/figcaption><\/figure>\n<h2><span class=\"ez-toc-section\" id=\"Preserve_Input_Order\"><\/span>Preserve Input Order<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>When the first occurrence order is part of the result, use dict.fromkeys() instead of a set. Modern dictionaries preserve insertion order, so this produces stable unique values without sorting them.<\/p>\n<div class=\"pythonpool-code-scroll\" style=\"max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;\">\n<pre><code class=\"language-python\">items = [\"red\", \"blue\", \"red\", \"green\"]\nstable_unique = list(dict.fromkeys(items))\nprint(stable_unique)<\/code><\/pre>\n<\/div>\n<h2><span class=\"ez-toc-section\" id=\"Handle_Unhashable_Members\"><\/span>Handle Unhashable Members<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Set members need a stable hash. Nested lists, dictionaries, and many mutable objects are unhashable, so set(items) raises TypeError. Convert the nested data to an appropriate immutable representation only when that representation is semantically correct.<\/p>\n<div class=\"pythonpool-code-scroll\" style=\"max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;\">\n<pre><code class=\"language-python\">items = [[1, 2], [1, 2], [3, 4]]\ntry:\n    print(set(items))\nexcept TypeError as error:\n    print(\"unhashable member:\", error)<\/code><\/pre>\n<\/div>\n<h2><span class=\"ez-toc-section\" id=\"Choose_The_Collection\"><\/span>Choose The Collection<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Use a set for uniqueness and fast membership, a list for sequence behavior, dict.fromkeys for stable deduplication, and sorted(set(items)) when a deterministic sorted result is explicitly required. These choices have different ordering and type contracts.<\/p>\n<div class=\"pythonpool-code-scroll\" style=\"max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;\">\n<pre><code class=\"language-python\">items = [3, 1, 3, 2]\nprint(set(items))\nprint(list(dict.fromkeys(items)))\nprint(sorted(set(items)))<\/code><\/pre>\n<\/div>\n<p>Python&#8217;s official <a href=\"https:\/\/docs.python.org\/3\/tutorial\/datastructures.html#sets\">set documentation<\/a> explains uniqueness and membership. Use a set only when its unordered collection contract matches the output you need.<\/p>\n<p>For related collection choices, compare <a href=\"https:\/\/www.pythonpool.com\/python-hashmaps\/\">hashmap fundamentals<\/a>, <a href=\"https:\/\/www.pythonpool.com\/python-ordereddict\/\">OrderedDict<\/a>, and <a href=\"https:\/\/www.pythonpool.com\/python-dictionary-size\/\">dictionary size<\/a> before deciding whether uniqueness, ordering, or lookup is the primary requirement.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Frequently_Asked_Questions\"><\/span>Frequently Asked Questions<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"How_do_I_convert_a_list_to_a_set_in_Python-2\"><\/span>How do I convert a list to a set in Python?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Pass the list to set(items), provided every item is hashable.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Does_converting_a_list_to_a_set_preserve_order-2\"><\/span>Does converting a list to a set preserve order?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>A set is not the right contract for preserving input order; use dict.fromkeys(items) when stable deduplication matters.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Why_does_converting_a_list_to_a_set_raise_TypeError\"><\/span>Why does converting a list to a set raise TypeError?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>At least one item is unhashable, such as a nested list or dictionary.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"How_do_I_convert_a_set_back_to_a_list\"><\/span>How do I convert a set back to a list?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Call list(values), but remember that the resulting order should not be treated as the original list order.<\/p>\n<p><script type=\"application\/ld+json\">{\"@context\":\"https:\/\/schema.org\",\"@type\":\"FAQPage\",\"mainEntity\":[{\"@type\":\"Question\",\"name\":\"How do I convert a list to a set in Python?\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Pass the list to set(items), provided every item is hashable.\"}},{\"@type\":\"Question\",\"name\":\"Does converting a list to a set preserve order?\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"A set is not the right contract for preserving input order; use dict.fromkeys(items) when stable deduplication matters.\"}},{\"@type\":\"Question\",\"name\":\"Why does converting a list to a set raise TypeError?\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"At least one item is unhashable, such as a nested list or dictionary.\"}},{\"@type\":\"Question\",\"name\":\"How do I convert a set back to a list?\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Call list(values), but remember that the resulting order should not be treated as the original list order.\"}}]}<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Convert Python lists to sets to remove duplicates, while understanding order, hashability, unhashable values, and when dict.fromkeys is safer.<\/p>\n","protected":false},"author":19,"featured_media":32381,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[15],"tags":[3971,3970,3969],"class_list":["post-11137","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-convert-a-list-to-set-python","tag-python-convert-a-list-to-a-set","tag-python-convert-list-to-set","infinite-scroll-item"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v20.1 (Yoast SEO v28.0) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Convert a List to a Set in Python: Duplicates and Order<\/title>\n<meta name=\"description\" content=\"Convert Python lists to sets to remove duplicates, while understanding order, hashability, unhashable values, and when dict.fromkeys is safer.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.pythonpool.com\/convert-list-to-set-python\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Convert a List to a Set in Python: Duplicates and Order\" \/>\n<meta property=\"og:description\" content=\"Convert Python lists to sets to remove duplicates, while understanding order, hashability, unhashable values, and when dict.fromkeys is safer.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pythonpool.com\/convert-list-to-set-python\/\" \/>\n<meta property=\"og:site_name\" content=\"Python Pool\" \/>\n<meta property=\"article:published_time\" content=\"2021-05-15T05:46:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-07-13T07:03:48+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/convert-list-to-set-python.png\" \/>\n<meta name=\"author\" content=\"Sagarika Daripa\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"Python Pool\" \/>\n<meta name=\"twitter:description\" content=\"Practical Python tutorials, error fixes, code examples, and project guides.\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/convert-list-to-set-python.png\" \/>\n<meta name=\"twitter:creator\" content=\"@pythonpool\" \/>\n<meta name=\"twitter:site\" content=\"@pythonpool\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sagarika Daripa\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/convert-list-to-set-python\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/convert-list-to-set-python\\\/\"},\"author\":{\"name\":\"Sagarika Daripa\",\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/#\\\/schema\\\/person\\\/092e9c8a9c793bd19f343d0b8a4009fa\"},\"headline\":\"Convert a List to a Set in Python: Duplicates and Order\",\"datePublished\":\"2021-05-15T05:46:30+00:00\",\"dateModified\":\"2026-07-13T07:03:48+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/convert-list-to-set-python\\\/\"},\"wordCount\":1052,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/convert-list-to-set-python\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.pythonpool.com\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/convert-list-to-set-python-guide-pythonpool.png\",\"keywords\":[\"convert a list to set python\",\"python convert a list to a set\",\"python convert list to set\"],\"articleSection\":[\"Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.pythonpool.com\\\/convert-list-to-set-python\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/convert-list-to-set-python\\\/\",\"url\":\"https:\\\/\\\/www.pythonpool.com\\\/convert-list-to-set-python\\\/\",\"name\":\"Convert a List to a Set in Python: Duplicates and Order\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/convert-list-to-set-python\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/convert-list-to-set-python\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.pythonpool.com\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/convert-list-to-set-python-guide-pythonpool.png\",\"datePublished\":\"2021-05-15T05:46:30+00:00\",\"dateModified\":\"2026-07-13T07:03:48+00:00\",\"description\":\"Convert Python lists to sets to remove duplicates, while understanding order, hashability, unhashable values, and when dict.fromkeys is safer.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/convert-list-to-set-python\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.pythonpool.com\\\/convert-list-to-set-python\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/convert-list-to-set-python\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.pythonpool.com\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/convert-list-to-set-python-guide-pythonpool.png\",\"contentUrl\":\"https:\\\/\\\/www.pythonpool.com\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/convert-list-to-set-python-guide-pythonpool.png\",\"width\":1350,\"height\":650,\"caption\":\"Convert list to set in Python guide showing duplicate list values converted to unique set values\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/convert-list-to-set-python\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.pythonpool.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Convert a List to a Set in Python: Duplicates and Order\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/#website\",\"url\":\"https:\\\/\\\/www.pythonpool.com\\\/\",\"name\":\"Python Pool\",\"description\":\"Practical Python tutorials, error fixes, code examples, and project guides.\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.pythonpool.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/#organization\",\"name\":\"Python Pool\",\"url\":\"https:\\\/\\\/www.pythonpool.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.pythonpool.com\\\/wp-content\\\/uploads\\\/2020\\\/08\\\/aa.png\",\"contentUrl\":\"https:\\\/\\\/www.pythonpool.com\\\/wp-content\\\/uploads\\\/2020\\\/08\\\/aa.png\",\"width\":452,\"height\":185,\"caption\":\"Python Pool\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/x.com\\\/pythonpool\",\"https:\\\/\\\/www.youtube.com\\\/c\\\/pythonpool\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/#\\\/schema\\\/person\\\/092e9c8a9c793bd19f343d0b8a4009fa\",\"name\":\"Sagarika Daripa\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b5061d7f84b9ce4980a65ef18a50bba2d1ce8f086e0478fe37bf01423050f927?s=96&d=wavatar&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b5061d7f84b9ce4980a65ef18a50bba2d1ce8f086e0478fe37bf01423050f927?s=96&d=wavatar&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b5061d7f84b9ce4980a65ef18a50bba2d1ce8f086e0478fe37bf01423050f927?s=96&d=wavatar&r=g\",\"caption\":\"Sagarika Daripa\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Convert a List to a Set in Python: Duplicates and Order","description":"Convert Python lists to sets to remove duplicates, while understanding order, hashability, unhashable values, and when dict.fromkeys is safer.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.pythonpool.com\/convert-list-to-set-python\/","og_locale":"en_US","og_type":"article","og_title":"Convert a List to a Set in Python: Duplicates and Order","og_description":"Convert Python lists to sets to remove duplicates, while understanding order, hashability, unhashable values, and when dict.fromkeys is safer.","og_url":"https:\/\/www.pythonpool.com\/convert-list-to-set-python\/","og_site_name":"Python Pool","article_published_time":"2021-05-15T05:46:30+00:00","article_modified_time":"2026-07-13T07:03:48+00:00","og_image":[{"url":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/convert-list-to-set-python.png","type":"","width":"","height":""}],"author":"Sagarika Daripa","twitter_card":"summary_large_image","twitter_title":"Python Pool","twitter_description":"Practical Python tutorials, error fixes, code examples, and project guides.","twitter_image":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/convert-list-to-set-python.png","twitter_creator":"@pythonpool","twitter_site":"@pythonpool","twitter_misc":{"Written by":"Sagarika Daripa","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pythonpool.com\/convert-list-to-set-python\/#article","isPartOf":{"@id":"https:\/\/www.pythonpool.com\/convert-list-to-set-python\/"},"author":{"name":"Sagarika Daripa","@id":"https:\/\/www.pythonpool.com\/#\/schema\/person\/092e9c8a9c793bd19f343d0b8a4009fa"},"headline":"Convert a List to a Set in Python: Duplicates and Order","datePublished":"2021-05-15T05:46:30+00:00","dateModified":"2026-07-13T07:03:48+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pythonpool.com\/convert-list-to-set-python\/"},"wordCount":1052,"commentCount":2,"publisher":{"@id":"https:\/\/www.pythonpool.com\/#organization"},"image":{"@id":"https:\/\/www.pythonpool.com\/convert-list-to-set-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/convert-list-to-set-python-guide-pythonpool.png","keywords":["convert a list to set python","python convert a list to a set","python convert list to set"],"articleSection":["Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pythonpool.com\/convert-list-to-set-python\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pythonpool.com\/convert-list-to-set-python\/","url":"https:\/\/www.pythonpool.com\/convert-list-to-set-python\/","name":"Convert a List to a Set in Python: Duplicates and Order","isPartOf":{"@id":"https:\/\/www.pythonpool.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.pythonpool.com\/convert-list-to-set-python\/#primaryimage"},"image":{"@id":"https:\/\/www.pythonpool.com\/convert-list-to-set-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/convert-list-to-set-python-guide-pythonpool.png","datePublished":"2021-05-15T05:46:30+00:00","dateModified":"2026-07-13T07:03:48+00:00","description":"Convert Python lists to sets to remove duplicates, while understanding order, hashability, unhashable values, and when dict.fromkeys is safer.","breadcrumb":{"@id":"https:\/\/www.pythonpool.com\/convert-list-to-set-python\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pythonpool.com\/convert-list-to-set-python\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pythonpool.com\/convert-list-to-set-python\/#primaryimage","url":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/convert-list-to-set-python-guide-pythonpool.png","contentUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/convert-list-to-set-python-guide-pythonpool.png","width":1350,"height":650,"caption":"Convert list to set in Python guide showing duplicate list values converted to unique set values"},{"@type":"BreadcrumbList","@id":"https:\/\/www.pythonpool.com\/convert-list-to-set-python\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pythonpool.com\/"},{"@type":"ListItem","position":2,"name":"Convert a List to a Set in Python: Duplicates and Order"}]},{"@type":"WebSite","@id":"https:\/\/www.pythonpool.com\/#website","url":"https:\/\/www.pythonpool.com\/","name":"Python Pool","description":"Practical Python tutorials, error fixes, code examples, and project guides.","publisher":{"@id":"https:\/\/www.pythonpool.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.pythonpool.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.pythonpool.com\/#organization","name":"Python Pool","url":"https:\/\/www.pythonpool.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png","contentUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png","width":452,"height":185,"caption":"Python Pool"},"image":{"@id":"https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/pythonpool","https:\/\/www.youtube.com\/c\/pythonpool"]},{"@type":"Person","@id":"https:\/\/www.pythonpool.com\/#\/schema\/person\/092e9c8a9c793bd19f343d0b8a4009fa","name":"Sagarika Daripa","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/b5061d7f84b9ce4980a65ef18a50bba2d1ce8f086e0478fe37bf01423050f927?s=96&d=wavatar&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/b5061d7f84b9ce4980a65ef18a50bba2d1ce8f086e0478fe37bf01423050f927?s=96&d=wavatar&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b5061d7f84b9ce4980a65ef18a50bba2d1ce8f086e0478fe37bf01423050f927?s=96&d=wavatar&r=g","caption":"Sagarika Daripa"}}]}},"_links":{"self":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/11137","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/users\/19"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/comments?post=11137"}],"version-history":[{"count":60,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/11137\/revisions"}],"predecessor-version":[{"id":41644,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/11137\/revisions\/41644"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/media\/32381"}],"wp:attachment":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/media?parent=11137"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/categories?post=11137"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/tags?post=11137"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}