{"id":10134,"date":"2021-06-23T05:59:59","date_gmt":"2021-06-23T00:29:59","guid":{"rendered":"https:\/\/www.konstantinfo.com\/blog\/?p=10134"},"modified":"2024-04-11T16:12:06","modified_gmt":"2024-04-11T10:42:06","slug":"python-3-10-whats-new","status":"publish","type":"post","link":"https:\/\/www.konstantinfo.com\/konstant-blog\/python-3-10-whats-new\/","title":{"rendered":"Python 3.10: What\u2019s New?"},"content":{"rendered":"<p>As of June 2021, Python 3.9 is the latest, and 3.10.0 b2 is coming up next. It is in beta testing enabling a larger audience to check the features and work upon bug fixes. New changes in Python 3.10 are not revolutionary but good to have. Let\u2019s take a look:<\/p>\n<h2>What\u2019s new in Python 3.10?<\/h2>\n<p><strong>Structural pattern matching<\/strong> &#8211; Python makes use of structural pattern making covering up for switch\/case-like syntax. It enables matching up for a set of values to be usable across various scenarios.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-10138\" src=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/06\/structural-pattern-matching.png\" alt=\"structural pattern matching\" width=\"575\" srcset=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/06\/structural-pattern-matching.png 575w, https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/06\/structural-pattern-matching-300x119.png 300w\" sizes=\"(max-width: 575px) 100vw, 575px\" \/><\/p>\n<p><strong>Precise Error Reporting<\/strong> \u2013 Python 3.10 goes along with the new parser, which is faster, robust, and easier for the Python team to maintain. It makes it easier to develop, generate syntax errors, and showcase relevant error messages.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-10137\" src=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/06\/precise-error-reporting.png\" alt=\"precise error reporting\" width=\"328\" srcset=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/06\/precise-error-reporting.png 328w, https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/06\/precise-error-reporting-300x90.png 300w\" sizes=\"(max-width: 328px) 100vw, 328px\" \/><\/p>\n<p><strong>Parameter specification variables<\/strong> \u2013 Python&#8217;s new syntax lets you describe the module and the callable (function). Information propagation across callable is an issue, which makes annotation of function decorators unmanageable.<\/p>\n<p>&#8216;typing.ParamSpec&#8217; and &#8216;typing.Concatenate&#8217; make it easy to annotate callables with more abstract type definition information.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-10136\" src=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/06\/parameter-specification-variables.png\" alt=\"parameter specification variables\" width=\"607\" srcset=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/06\/parameter-specification-variables.png 607w, https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/06\/parameter-specification-variables-300x178.png 300w\" sizes=\"(max-width: 607px) 100vw, 607px\" \/><\/p>\n<p>You cannot pass every possible detail with the linter &#8211; (1) What types should you &#8216;pass&#8217; to the functions that the decorator processes etc. The linter cannot catch the invalid types. To make it work with a new parameter specification variable syntax:<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-10135\" src=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/06\/new-parameter-specification-variable-syntax.png\" alt=\"new parameter specification variable syntax\" width=\"613\" srcset=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/06\/new-parameter-specification-variable-syntax.png 613w, https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/06\/new-parameter-specification-variable-syntax-300x186.png 300w\" sizes=\"(max-width: 613px) 100vw, 613px\" \/><\/p>\n<p>ParamSpec indicates the positional and keyword arguments. Concatenate depicts how &#8216;arguments&#8217; are added or removed with decorators.<\/p>\n<p><strong>Better Context Managers \u2013 <\/strong>Python 3.10 enables enclosing parenthesis for continuation across multiple text lines in context managers. It allows you to manage multiple files in a much more organized manner.<\/p>\n<h2>More Changes in Python 3.10<\/h2>\n<ul>\n<li>Now Union Types are expressed as Union [X|Y] instead of X|Y.<\/li>\n<li>The zip built-in integrates multiple iterations within a strict keyword. If the value is positive, it causes zip to raise an exception if one of the iterations is exhausted before the others.<\/li>\n<li>With statement now supports multi-line, parenthetical syntax.<\/li>\n<li>Variables are declared as type aliases, allowing forward references, robust errors involving types, distinct type declarations in scopes.<\/li>\n<li>CPython requires OpenSSL 1.1.1 or higher to modernize one of its dependencies.<\/li>\n<\/ul>\n<p><strong>Also read:<\/strong><\/p>\n<ul>\n<li><a href=\"https:\/\/www.konstantinfo.com\/blog\/perl-vs-python\/\" target=\"_blank\">Perl vs Python<\/a><\/li>\n<li><a href=\"https:\/\/www.konstantinfo.com\/blog\/java-vs-python\/\" target=\"_blank\">Java vs Python<\/a><\/li>\n<\/ul>\n<h2>Conclusive: Where can we go from here?<\/h2>\n<p>Python 3.10 is in the alpha stage of development and ready for beta testing \u2013 bug fixes and improvements before deployment. It will bring about changes in (1) Error messages, (2) Structural Pattern Matching (Switch Statement), (3) The Union Operator, (4) Better Context Managers. It will make things simpler and more organized. However, it will not bring changes to the Python code. We described just a bit of what is going to change in an upcoming update. Follow complete Python Documentation for details. Contact Konstant\u2019s <a href=\"https:\/\/www.konstantinfo.com\/python-development-company\" target=\"_blank\">Python Development Company<\/a> if you wish to create a Python Application!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As of June 2021, Python 3.9 is the latest, and 3.10.0 b2 is coming up next. It is in beta testing enabling a larger audience to check the features and work upon bug fixes. New changes in Python 3.10 are not revolutionary but good to have. Let\u2019s take a look: What\u2019s new in Python 3.10?&hellip; <a class=\"more-link\" href=\"https:\/\/www.konstantinfo.com\/konstant-blog\/python-3-10-whats-new\/\">Continue reading <span class=\"screen-reader-text\">Python 3.10: What\u2019s New?<\/span><\/a><\/p>\n","protected":false},"author":21,"featured_media":10146,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[150],"tags":[1587],"class_list":["post-10134","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology","tag-python-3-10","entry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Python 3.10: What\u2019s New? - Konstantinfo<\/title>\n<meta name=\"description\" content=\"Here is a gist of Python features that append to the existing ones in the upcoming Python 3.10!\" \/>\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.konstantinfo.com\/konstant-blog\/python-3-10-whats-new\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python 3.10: What\u2019s New? - Konstantinfo\" \/>\n<meta property=\"og:description\" content=\"Here is a gist of Python features that append to the existing ones in the upcoming Python 3.10!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.konstantinfo.com\/konstant-blog\/python-3-10-whats-new\/\" \/>\n<meta property=\"og:site_name\" content=\"Konstantinfo\" \/>\n<meta property=\"article:author\" content=\"http:\/\/www.facebook.com\/konstant.info\" \/>\n<meta property=\"article:published_time\" content=\"2021-06-23T00:29:59+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-11T10:42:06+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/06\/python-3.10-2.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1008\" \/>\n\t<meta property=\"og:image:height\" content=\"448\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Neeti Kotia\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@konstantinfo\" \/>\n<meta name=\"twitter:site\" content=\"@konstantinfo\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Neeti Kotia\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.konstantinfo.com\/konstant-blog\/python-3-10-whats-new\/\",\"url\":\"https:\/\/www.konstantinfo.com\/konstant-blog\/python-3-10-whats-new\/\",\"name\":\"Python 3.10: What\u2019s New? - Konstantinfo\",\"isPartOf\":{\"@id\":\"https:\/\/www.konstantinfo.com\/konstant-blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.konstantinfo.com\/konstant-blog\/python-3-10-whats-new\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.konstantinfo.com\/konstant-blog\/python-3-10-whats-new\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/06\/python-3.10-2.jpg\",\"datePublished\":\"2021-06-23T00:29:59+00:00\",\"dateModified\":\"2024-04-11T10:42:06+00:00\",\"author\":{\"@id\":\"https:\/\/www.konstantinfo.com\/konstant-blog\/#\/schema\/person\/f21f3944d0e3bceb3e4884381bb224b9\"},\"description\":\"Here is a gist of Python features that append to the existing ones in the upcoming Python 3.10!\",\"breadcrumb\":{\"@id\":\"https:\/\/www.konstantinfo.com\/konstant-blog\/python-3-10-whats-new\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.konstantinfo.com\/konstant-blog\/python-3-10-whats-new\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.konstantinfo.com\/konstant-blog\/python-3-10-whats-new\/#primaryimage\",\"url\":\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/06\/python-3.10-2.jpg\",\"contentUrl\":\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/06\/python-3.10-2.jpg\",\"width\":1008,\"height\":448,\"caption\":\"python 3.10\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.konstantinfo.com\/konstant-blog\/python-3-10-whats-new\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.konstantinfo.com\/konstant-blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python 3.10: What\u2019s New?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.konstantinfo.com\/konstant-blog\/#website\",\"url\":\"https:\/\/www.konstantinfo.com\/konstant-blog\/\",\"name\":\"Konstantinfo\",\"description\":\"Welcome to Konstant Info\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.konstantinfo.com\/konstant-blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.konstantinfo.com\/konstant-blog\/#\/schema\/person\/f21f3944d0e3bceb3e4884381bb224b9\",\"name\":\"Neeti Kotia\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.konstantinfo.com\/konstant-blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2018\/02\/Neeti-150x150.jpg\",\"contentUrl\":\"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2018\/02\/Neeti-150x150.jpg\",\"caption\":\"Neeti Kotia\"},\"description\":\"Neeti Kotia is a technology journalist who seeks to analyze the advancements and developments in technology that affect our everyday lives. Her articles primarily focus upon the business, social, cultural, and entertainment side of the technology sector.\",\"sameAs\":[\"http:\/\/www.konstantinfo.com\",\"http:\/\/www.facebook.com\/konstant.info\",\"https:\/\/x.com\/konstantinfo\"],\"url\":\"https:\/\/www.konstantinfo.com\/konstant-blog\/author\/neeti-kotia\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python 3.10: What\u2019s New? - Konstantinfo","description":"Here is a gist of Python features that append to the existing ones in the upcoming Python 3.10!","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.konstantinfo.com\/konstant-blog\/python-3-10-whats-new\/","og_locale":"en_US","og_type":"article","og_title":"Python 3.10: What\u2019s New? - Konstantinfo","og_description":"Here is a gist of Python features that append to the existing ones in the upcoming Python 3.10!","og_url":"https:\/\/www.konstantinfo.com\/konstant-blog\/python-3-10-whats-new\/","og_site_name":"Konstantinfo","article_author":"http:\/\/www.facebook.com\/konstant.info","article_published_time":"2021-06-23T00:29:59+00:00","article_modified_time":"2024-04-11T10:42:06+00:00","og_image":[{"width":1008,"height":448,"url":"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/06\/python-3.10-2.jpg","type":"image\/jpeg"}],"author":"Neeti Kotia","twitter_card":"summary_large_image","twitter_creator":"@konstantinfo","twitter_site":"@konstantinfo","twitter_misc":{"Written by":"Neeti Kotia","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.konstantinfo.com\/konstant-blog\/python-3-10-whats-new\/","url":"https:\/\/www.konstantinfo.com\/konstant-blog\/python-3-10-whats-new\/","name":"Python 3.10: What\u2019s New? - Konstantinfo","isPartOf":{"@id":"https:\/\/www.konstantinfo.com\/konstant-blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.konstantinfo.com\/konstant-blog\/python-3-10-whats-new\/#primaryimage"},"image":{"@id":"https:\/\/www.konstantinfo.com\/konstant-blog\/python-3-10-whats-new\/#primaryimage"},"thumbnailUrl":"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/06\/python-3.10-2.jpg","datePublished":"2021-06-23T00:29:59+00:00","dateModified":"2024-04-11T10:42:06+00:00","author":{"@id":"https:\/\/www.konstantinfo.com\/konstant-blog\/#\/schema\/person\/f21f3944d0e3bceb3e4884381bb224b9"},"description":"Here is a gist of Python features that append to the existing ones in the upcoming Python 3.10!","breadcrumb":{"@id":"https:\/\/www.konstantinfo.com\/konstant-blog\/python-3-10-whats-new\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.konstantinfo.com\/konstant-blog\/python-3-10-whats-new\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.konstantinfo.com\/konstant-blog\/python-3-10-whats-new\/#primaryimage","url":"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/06\/python-3.10-2.jpg","contentUrl":"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2021\/06\/python-3.10-2.jpg","width":1008,"height":448,"caption":"python 3.10"},{"@type":"BreadcrumbList","@id":"https:\/\/www.konstantinfo.com\/konstant-blog\/python-3-10-whats-new\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.konstantinfo.com\/konstant-blog\/"},{"@type":"ListItem","position":2,"name":"Python 3.10: What\u2019s New?"}]},{"@type":"WebSite","@id":"https:\/\/www.konstantinfo.com\/konstant-blog\/#website","url":"https:\/\/www.konstantinfo.com\/konstant-blog\/","name":"Konstantinfo","description":"Welcome to Konstant Info","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.konstantinfo.com\/konstant-blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.konstantinfo.com\/konstant-blog\/#\/schema\/person\/f21f3944d0e3bceb3e4884381bb224b9","name":"Neeti Kotia","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.konstantinfo.com\/konstant-blog\/#\/schema\/person\/image\/","url":"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2018\/02\/Neeti-150x150.jpg","contentUrl":"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2018\/02\/Neeti-150x150.jpg","caption":"Neeti Kotia"},"description":"Neeti Kotia is a technology journalist who seeks to analyze the advancements and developments in technology that affect our everyday lives. Her articles primarily focus upon the business, social, cultural, and entertainment side of the technology sector.","sameAs":["http:\/\/www.konstantinfo.com","http:\/\/www.facebook.com\/konstant.info","https:\/\/x.com\/konstantinfo"],"url":"https:\/\/www.konstantinfo.com\/konstant-blog\/author\/neeti-kotia\/"}]}},"show_toc":false,"table_of_content":[],"faq":[],"related_blogs":[{"id":5342,"title":"How Much Does It Cost to Develop an Augmented Reality App?","slug":"how-much-does-it-cost-to-develop-an-augmented-reality-app","link":"https:\/\/www.konstantinfo.com\/konstant-blog\/how-much-does-it-cost-to-develop-an-augmented-reality-app\/","modified":"2026-05-04 13:26:23","excerpt":"Augmented Reality app development seems like magic. Like what you see on your mobile screen can be generated in real...","image":"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2017\/11\/cost-of-Augmented-Reality-300x133.jpg"},{"id":11017,"title":"Complete Guide to Cloud Service Models: SaaS, IaaS, PaaS","slug":"cloud-service-models","link":"https:\/\/www.konstantinfo.com\/konstant-blog\/cloud-service-models\/","modified":"2026-04-24 14:50:31","excerpt":"As organizations' IT infrastructures become increasingly burdened and customers' demands keep growing, cloud services models are emerging as the fastest,...","image":"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2024\/10\/cloud-service-models-1.webp"},{"id":10551,"title":"SaaS Application Development: What You Should Know to Build a Successful SaaS Business?","slug":"saas-application-development","link":"https:\/\/www.konstantinfo.com\/konstant-blog\/saas-application-development\/","modified":"2026-02-26 16:47:40","excerpt":"When was the last time you attended an online meeting using Zoom? Be it a small business or larger corporations...","image":"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-content\/uploads\/2022\/03\/saas-application-development.webp"}],"_links":{"self":[{"href":"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-json\/wp\/v2\/posts\/10134","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-json\/wp\/v2\/users\/21"}],"replies":[{"embeddable":true,"href":"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-json\/wp\/v2\/comments?post=10134"}],"version-history":[{"count":1,"href":"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-json\/wp\/v2\/posts\/10134\/revisions"}],"predecessor-version":[{"id":10147,"href":"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-json\/wp\/v2\/posts\/10134\/revisions\/10147"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-json\/wp\/v2\/media\/10146"}],"wp:attachment":[{"href":"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-json\/wp\/v2\/media?parent=10134"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-json\/wp\/v2\/categories?post=10134"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.konstantinfo.com\/konstant-blog\/wp-json\/wp\/v2\/tags?post=10134"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}