<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

  <title>Real Python</title>
  <link href="https://realpython.com/atom.xml" rel="self"/>
  <link href="https://realpython.com/"/>
  <updated>2025-10-10T12:00:00+00:00</updated>
  <id>https://realpython.com/</id>
  <author>
    <name>Real Python</name>
  </author>

  
    <entry>
      <title>The Real Python Podcast – Episode #269: Python 3.14: Exploring the New Features</title>
      <id>https://realpython.com/podcasts/rpp/269/</id>
      <link href="https://realpython.com/podcasts/rpp/269/"/>
      <updated>2025-10-10T12:00:00+00:00</updated>
      <summary>Python 3.14 is here! Christopher Trudeau returns to discuss the new version with Real Python team member Bartosz Zaczyński. This year, Bartosz coordinated the series of preview articles with members of the Real Python team and wrote the showcase tutorial, &quot;Python 3.14: Cool New Features for You to Try.&quot; Christopher&#x27;s video course, &quot;What&#x27;s New in Python 3.14&quot;, covers the topics from the article and shows the new features in action.</summary>
      <content type="html">
        &lt;p&gt;Python 3.14 is here! Christopher Trudeau returns to discuss the new version with Real Python team member Bartosz Zaczyński. This year, Bartosz coordinated the series of preview articles with members of the Real Python team and wrote the showcase tutorial, &quot;Python 3.14: Cool New Features for You to Try.&quot; Christopher&#x27;s video course, &quot;What&#x27;s New in Python 3.14&quot;, covers the topics from the article and shows the new features in action.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Python 3.14: Cool New Features for You to Try</title>
      <id>https://realpython.com/python314-new-features/</id>
      <link href="https://realpython.com/python314-new-features/"/>
      <updated>2025-10-08T14:00:00+00:00</updated>
      <summary>Learn what&#x27;s new in Python 3.14, including an upgraded REPL, template strings, lazy annotations, and subinterpreters, with examples to try in your code.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;&lt;a href=&quot;https://www.python.org/downloads/release/python-3140/&quot;&gt;Python 3.14&lt;/a&gt; was released on &lt;a href=&quot;https://peps.python.org/pep-0745/&quot;&gt;October 7, 2025&lt;/a&gt;. While many of its biggest changes happen under the hood, there are practical improvements you’ll notice right away. This version sharpens the language’s tools, boosts ergonomics, and opens doors to new capabilities without forcing you to rewrite everything.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this tutorial, you’ll explore features like:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A smarter, more &lt;strong&gt;colorful REPL&lt;/strong&gt; experience&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Error messages&lt;/strong&gt; that guide you toward fixes&lt;/li&gt;
&lt;li&gt;Safer hooks for &lt;strong&gt;live debugging&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Template strings (&lt;strong&gt;t-strings&lt;/strong&gt;) for controlled interpolation&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Deferred annotation evaluation&lt;/strong&gt; to simplify typing&lt;/li&gt;
&lt;li&gt;New concurrency options like &lt;strong&gt;subinterpreters&lt;/strong&gt; and a &lt;strong&gt;free-threaded&lt;/strong&gt; build&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you want to try out the examples, make sure you run Python 3.14 or a compatible &lt;a href=&quot;https://realpython.com/python-pre-release/&quot;&gt;preview release&lt;/a&gt;.&lt;/p&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; On Unix systems, when you create a new &lt;a href=&quot;https://realpython.com/python-virtual-environments-a-primer/&quot;&gt;virtual environment&lt;/a&gt; with the new Python 3.14, you’ll spot a quirky alias:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;console&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--yellow&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Shell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; role=&quot;button&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp gp-VirtualEnv&quot;&gt;(venv)&lt;/span&gt; &lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;𝜋thon
&lt;span class=&quot;go&quot;&gt;Python 3.14.0 (main, Oct  7 2025, 17:32:06) [GCC 14.2.0] on linux&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;This feature is exclusive to the 3.14 release as a tribute to the mathematical constant &lt;a href=&quot;https://en.wikipedia.org/wiki/Pi&quot;&gt;π (pi)&lt;/a&gt;, whose rounded value, 3.14, is familiar to most people.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;As you read on, you’ll find detailed examples and explanations for each feature. Along the way, you’ll get tips on how they can streamline your coding today and prepare you for what’s coming next.&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown&gt;Get Your Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python314-new-features-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python314-new-features-code&quot; markdown&gt;Click here to download the free sample code&lt;/a&gt; that you’ll use to learn about the new features in Python 3.14.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;container border rounded text-wrap-pretty my-3&quot;&gt;

  &lt;p class=&quot;my-3&quot;&gt;&lt;mark class=&quot;marker-highlight&quot;&gt;&lt;strong&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt; Take the Quiz:&lt;/strong&gt;&lt;/mark&gt; Test your knowledge with our interactive “Python 3.14: Cool New Features for You to Try” quiz. You’ll receive a score upon completion to help you track your learning progress:&lt;/p&gt;

  &lt;hr&gt;

  &lt;div class=&quot;row my-3&quot;&gt;
    &lt;div class=&quot;col-xs-12 col-sm-4 col-md-3 align-self-center&quot;&gt;

      &lt;a href=&quot;/quizzes/python314-new-features/&quot; tabindex=&quot;-1&quot;&gt;
        &lt;div class=&quot;embed-responsive embed-responsive-16by9&quot;&gt;

            &lt;img class=&quot;card-img-top m-0 p-0 embed-responsive-item rounded&quot; style=&quot;object-fit: contain; background: #e5c6aa;&quot; alt=&quot;Python 3.14: Cool New Features for You to Try&quot; src=&quot;https://files.realpython.com/media/Python-3.14-Cool-New-Features_Watermarked.1f256aff1d4b.jpg&quot; width=&quot;1920&quot; height=&quot;1080&quot; srcset=&quot;/cdn-cgi/image/width=480,format=auto/https://files.realpython.com/media/Python-3.14-Cool-New-Features_Watermarked.1f256aff1d4b.jpg 480w, /cdn-cgi/image/width=640,format=auto/https://files.realpython.com/media/Python-3.14-Cool-New-Features_Watermarked.1f256aff1d4b.jpg 640w, /cdn-cgi/image/width=960,format=auto/https://files.realpython.com/media/Python-3.14-Cool-New-Features_Watermarked.1f256aff1d4b.jpg 960w, /cdn-cgi/image/width=1920,format=auto/https://files.realpython.com/media/Python-3.14-Cool-New-Features_Watermarked.1f256aff1d4b.jpg 1920w&quot; sizes=&quot;(min-width: 1200px) 142px, (min-width: 1000px) 122px, (min-width: 780px) 112px, (min-width: 580px) 139px, calc(100vw - 62px)&quot;&gt;


          &lt;div class=&quot;card-img-overlay d-flex align-items-center&quot;&gt;
            &lt;div class=&quot;mx-auto&quot;&gt;
              &lt;span class=&quot;text-light&quot; style=&quot;opacity: 0.90;&quot;&gt;&lt;span class=&quot;icon baseline scale2x&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/a&gt;

    &lt;/div&gt;
    &lt;div class=&quot;col&quot;&gt;
      &lt;div class=&quot;mt-3 d-md-none&quot;&gt;&lt;/div&gt; 
      &lt;p class=&quot;small text-muted mb-0&quot;&gt;&lt;strong&gt;Interactive Quiz&lt;/strong&gt;&lt;/p&gt;
      &lt;a href=&quot;/quizzes/python314-new-features/&quot; class=&quot;stretched-link&quot;&gt;&lt;span class=&quot;my-0 h4&quot;&gt;Python 3.14: Cool New Features for You to Try&lt;/span&gt;&lt;/a&gt; 
      &lt;p class=&quot;text-muted mb-0 small&quot;&gt;In this quiz, you&#x27;ll test your understanding of the new features introduced in Python 3.14. By working through this quiz, you&#x27;ll review the key updates and improvements in this version of Python.&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;

&lt;/div&gt;

&lt;h2 id=&quot;developer-experience-improvements&quot;&gt;Developer Experience Improvements&lt;a class=&quot;headerlink&quot; href=&quot;#developer-experience-improvements&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Python 3.14 continues the trend of refining the language’s ergonomics. This release enhances the built-in interactive shell with live syntax highlighting and smarter autocompletion. It also improves syntax and runtime error messages, making them clearer and more actionable. While these upgrades don’t change the language itself, they boost your productivity as you write, test, and debug code.&lt;/p&gt;
&lt;h3 id=&quot;even-friendlier-python-repl&quot;&gt;Even Friendlier Python REPL&lt;a class=&quot;headerlink&quot; href=&quot;#even-friendlier-python-repl&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Python’s interactive interpreter, also known as the &lt;a href=&quot;/ref/glossary/repl/&quot; class=&quot;ref-link&quot;&gt;REPL&lt;/a&gt;, has always been the quickest way to try out a snippet of code, &lt;a href=&quot;/ref/glossary/debugging/&quot; class=&quot;ref-link&quot;&gt;debug&lt;/a&gt; an issue, or explore a third-party library. It can even serve as a handy calculator or a bare-bones data analysis tool. Although your mileage may vary, you typically start the REPL by running the &lt;code&gt;python&lt;/code&gt; command in your &lt;a href=&quot;https://realpython.com/terminal-commands/&quot;&gt;terminal&lt;/a&gt; without passing any arguments:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;console&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--yellow&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Shell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; role=&quot;button&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;python
&lt;span class=&quot;go&quot;&gt;Python 3.14.0 (main, Oct  7 2025, 17:32:06) [GCC 14.2.0] on linux&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;The humble prompt, which consists of three chevrons (&lt;code&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/code&gt;), invites you to type a Python &lt;a href=&quot;/ref/glossary/statement/&quot; class=&quot;ref-link&quot;&gt;statement&lt;/a&gt; or an &lt;a href=&quot;/ref/glossary/expression/&quot; class=&quot;ref-link&quot;&gt;expression&lt;/a&gt; for immediate evaluation. As soon as you press &lt;span class=&quot;keys&quot;&gt;&lt;kbd class=&quot;key-enter&quot;&gt;Enter&lt;/kbd&gt;&lt;/span&gt;, you’ll instantly see the computed result without having to create any source files or configure a project workspace. After each result, the familiar prompt returns, ready to accept your next command:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;pycon&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--blue&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Python&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; role=&quot;button&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;4&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;For years, the stock &lt;a href=&quot;https://realpython.com/python-repl/&quot;&gt;Python REPL&lt;/a&gt; remained intentionally minimal. It was fast and reliable, but lacked the polish of alternative shells built by the community, like &lt;a href=&quot;https://realpython.com/ipython-interactive-python-shell/&quot;&gt;IPython&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/ptpython-shell/&quot;&gt;ptpython&lt;/a&gt;, or &lt;a href=&quot;https://realpython.com/bpython-alternative-python-repl/&quot;&gt;bpython&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;That started to change in &lt;a href=&quot;https://realpython.com/python313-new-features/&quot;&gt;Python 3.13&lt;/a&gt;, which adopted a &lt;a href=&quot;https://realpython.com/python313-repl/&quot;&gt;modern REPL&lt;/a&gt; based on &lt;a href=&quot;https://github.com/pypy/pyrepl&quot;&gt;PyREPL&lt;/a&gt; borrowed from the &lt;a href=&quot;https://realpython.com/pypy-faster-python/&quot;&gt;PyPy&lt;/a&gt; project. This upgrade introduced multiline editing, smarter history browsing, and improved &lt;span class=&quot;keys&quot;&gt;&lt;kbd class=&quot;key-tab&quot;&gt;Tab&lt;/kbd&gt;&lt;/span&gt; completion, while keeping the simplicity of the classic REPL.&lt;/p&gt;
&lt;p&gt;Python 3.14 takes the interactive shell experience to the next level, introducing two new features:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Syntax highlighting:&lt;/strong&gt; Real-time syntax highlighting with configurable color themes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Code completion:&lt;/strong&gt; Autocompletion of module names inside &lt;code&gt;import&lt;/code&gt; statements&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Together, these improvements make the built-in REPL feel closer to a full-fledged &lt;a href=&quot;https://realpython.com/python-ides-code-editors-guide/&quot;&gt;code editor&lt;/a&gt; while keeping it lightweight and always available. The Python REPL now highlights code as you type. &lt;a href=&quot;https://realpython.com/python-keywords/&quot;&gt;Keywords&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/python-strings/&quot;&gt;strings&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/python-comments-guide/&quot;&gt;comments&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/python-numbers/&quot;&gt;numbers&lt;/a&gt;, and &lt;a href=&quot;https://realpython.com/python-operators-expressions/&quot;&gt;operators&lt;/a&gt; each get their own color, using &lt;a href=&quot;https://en.wikipedia.org/wiki/ANSI_escape_code&quot;&gt;ANSI escape codes&lt;/a&gt; similar to those that already color &lt;a href=&quot;https://docs.python.org/3/glossary.html#term-0&quot;&gt;prompts&lt;/a&gt; and &lt;a href=&quot;https://realpython.com/python-traceback/&quot;&gt;tracebacks&lt;/a&gt; in Python 3.13:&lt;/p&gt;
&lt;figure&gt;
  &lt;div class=&quot;embed-responsive embed-responsive-16by9 rounded mb-3 &quot;&gt;
    &lt;iframe loading=&quot;lazy&quot; class=&quot;embed-responsive-item&quot; src=&quot;https://player.vimeo.com/video/1122576168?background=1&quot; frameborder=&quot;0&quot; allow=&quot;fullscreen&quot; allowfullscreen&gt;&lt;/iframe&gt;
  &lt;/div&gt;
  &lt;figcaption class=&quot;figure-caption text-center&quot;&gt;Python 3.14 Syntax Highlighting in the REPL&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;Notice how the colors shift as you type, once the interactive shell has enough context to parse your input. In particular, tokens such as the &lt;a href=&quot;/ref/keywords/underscore/&quot; class=&quot;ref-link&quot;&gt;underscore (&lt;code&gt;_&lt;/code&gt;)&lt;/a&gt; are recognized as &lt;a href=&quot;/ref/glossary/soft-keyword/&quot; class=&quot;ref-link&quot;&gt;soft keywords&lt;/a&gt; only in the context of &lt;a href=&quot;https://realpython.com/structural-pattern-matching/&quot;&gt;pattern matching&lt;/a&gt;, and Python highlights them in a distinct color to set them apart. This colorful output also shows up in the &lt;a href=&quot;https://realpython.com/python-debugging-pdb/&quot;&gt;Python debugger (pdb)&lt;/a&gt; when you set a &lt;a href=&quot;/ref/builtin-functions/breakpoint/&quot; class=&quot;ref-link&quot;&gt;&lt;code&gt;breakpoint()&lt;/code&gt;&lt;/a&gt; on a given line of code, for example.&lt;/p&gt;
&lt;p&gt;Additionally, a few of the &lt;a href=&quot;/ref/glossary/standard-library/&quot; class=&quot;ref-link&quot;&gt;standard-library&lt;/a&gt; modules can now take advantage of this new syntax-coloring capability of the Python interpreter:&lt;/p&gt;
&lt;figure&gt;
  &lt;div class=&quot;embed-responsive embed-responsive-16by9 rounded mb-3 &quot;&gt;
    &lt;iframe loading=&quot;lazy&quot; class=&quot;embed-responsive-item&quot; src=&quot;https://player.vimeo.com/video/1122581196?background=1&quot; frameborder=&quot;0&quot; allow=&quot;fullscreen&quot; allowfullscreen&gt;&lt;/iframe&gt;
  &lt;/div&gt;
  &lt;figcaption class=&quot;figure-caption text-center&quot;&gt;Colorful Output in Python 3.14&#x27;s Standard-Library Modules&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;The &lt;a href=&quot;https://realpython.com/command-line-interfaces-python-argparse/&quot;&gt;&lt;code&gt;argparse&lt;/code&gt;&lt;/a&gt; module displays a colorful help message, the &lt;a href=&quot;https://realpython.com/python-calendar-module/&quot;&gt;&lt;code&gt;calendar&lt;/code&gt;&lt;/a&gt; module highlights the current day, the &lt;a href=&quot;https://realpython.com/python-json/&quot;&gt;&lt;code&gt;json&lt;/code&gt;&lt;/a&gt; module &lt;a href=&quot;https://realpython.com/python-pretty-print/&quot;&gt;pretty-prints&lt;/a&gt; and colorizes &lt;a href=&quot;/ref/glossary/json/&quot; class=&quot;ref-link&quot;&gt;JSON&lt;/a&gt; documents. Finally, the &lt;a href=&quot;https://realpython.com/python-unittest/&quot;&gt;&lt;code&gt;unittest&lt;/code&gt;&lt;/a&gt; module provides a colorful output for failed &lt;a href=&quot;https://realpython.com/python-assert-statement/&quot;&gt;assertions&lt;/a&gt; to make reading and diagnosing them easier.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python314-new-features/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python314-new-features/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Quiz: Python 3.14: Cool New Features for You to Try</title>
      <id>https://realpython.com/quizzes/python314-new-features/</id>
      <link href="https://realpython.com/quizzes/python314-new-features/"/>
      <updated>2025-10-08T12:00:00+00:00</updated>
      <summary>In this quiz, you&#x27;ll test your understanding of the new features introduced in Python 3.14. By working through this quiz, you&#x27;ll review the key updates and improvements in this version of Python.</summary>
      <content type="html">
        &lt;p&gt;In this quiz, you&amp;rsquo;ll test your understanding of
&lt;a href=&quot;https://realpython.com/python314-new-features/&quot;&gt;Python 3.14: Cool New Features for You to Try&lt;/a&gt;. By working through this quiz, you&amp;rsquo;ll review the key updates and improvements in this version of Python.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>What&#x27;s New in Python 3.14</title>
      <id>https://realpython.com/courses/whats-new-python-314/</id>
      <link href="https://realpython.com/courses/whats-new-python-314/"/>
      <updated>2025-10-07T14:00:00+00:00</updated>
      <summary>Covers Python 3.14&#x27;s key changes: free-threading, subinterpreters, t-strings, lazy annotations, new REPL features, and improved error messages.</summary>
      <content type="html">
        &lt;p&gt;Python 3.14 was published on &lt;a href=&quot;https://peps.python.org/pep-0745/&quot;&gt;October 7, 2025&lt;/a&gt;. While many of its biggest changes happen under the hood, there are practical improvements you&amp;rsquo;ll notice right away. This version sharpens the language&amp;rsquo;s tools, boosts ergonomics, and opens doors to new capabilities without forcing you to rewrite everything.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this video course, you&amp;rsquo;ll explore features like:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A smarter, more &lt;strong&gt;colorful REPL&lt;/strong&gt; experience&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Error messages&lt;/strong&gt; that guide you toward fixes&lt;/li&gt;
&lt;li&gt;Safer hooks for &lt;strong&gt;live debugging&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Template strings (&lt;strong&gt;t-strings&lt;/strong&gt;) for controlled interpolation&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Deferred annotation evaluation&lt;/strong&gt; to simplify typing&lt;/li&gt;
&lt;li&gt;New concurrency options like &lt;strong&gt;subinterpreters&lt;/strong&gt; and a &lt;strong&gt;free-threaded&lt;/strong&gt; build&lt;/li&gt;
&lt;/ul&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>It&#x27;s Almost Time for Python 3.14 and Other Python News</title>
      <id>https://realpython.com/python-news-october-2025/</id>
      <link href="https://realpython.com/python-news-october-2025/"/>
      <updated>2025-10-06T14:00:00+00:00</updated>
      <summary>The final release of Python 3.14 is almost here! Plus, there&#x27;s Django 6.0 alpha, key PEP updates, PSF board results, and fresh Real Python resources.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;&lt;strong&gt;Python 3.14&lt;/strong&gt; nears release with new features in sight, and &lt;strong&gt;Django 6.0 alpha&lt;/strong&gt; hints at what’s next for the web framework. Several &lt;strong&gt;PEPs&lt;/strong&gt; have landed, including improvements to type annotations and support for the free-threaded Python effort. &lt;/p&gt;
&lt;p&gt;Plus, the &lt;strong&gt;Python Software Foundation&lt;/strong&gt; announced new board members, while Real Python dropped a bundle of fresh tutorials and updates. Read on to learn what’s new in the world of Python this month! &lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown&gt;Join Now:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/newsletter/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-newsletter&quot; markdown&gt;Click here to join the Real Python Newsletter&lt;/a&gt; and you’ll never miss another Python tutorial, course, or news update.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;python-314-reaches-release-candidate-3&quot;&gt;Python 3.14 Reaches Release Candidate 3&lt;a class=&quot;headerlink&quot; href=&quot;#python-314-reaches-release-candidate-3&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://pythoninsider.blogspot.com/2025/09/python-3140rc3-is-go.html&quot;&gt;Python 3.14.0rc3&lt;/a&gt; was announced in September, bringing the next major version of Python one step closer to final release. This release candidate includes critical bug fixes, final tweaks to new features, and overall stability improvements. &lt;/p&gt;
&lt;p&gt;Python 3.14 is expected to introduce new syntax options, enhanced &lt;a href=&quot;/ref/glossary/standard-library/&quot; class=&quot;ref-link&quot;&gt;standard-library&lt;/a&gt; modules, and performance boosts driven by internal C &lt;a href=&quot;/ref/glossary/api/&quot; class=&quot;ref-link&quot;&gt;API&lt;/a&gt; changes. For the complete list of changes in Python 3.14, consult the official &lt;a href=&quot;https://docs.python.org/3.14/whatsnew/3.14.html&quot;&gt;What’s new in Python 3.14&lt;/a&gt; documentation.&lt;/p&gt;
&lt;p&gt;The release also builds upon ongoing work toward making &lt;a href=&quot;/ref/glossary/cpython/&quot; class=&quot;ref-link&quot;&gt;CPython&lt;/a&gt; &lt;a href=&quot;https://realpython.com/python-news-july-2025/&quot;&gt;free-threaded&lt;/a&gt;, an effort that will eventually allow better use of multicore CPUs. Developers are encouraged to test their projects with the RC to help identify regressions or issues before the official release. &lt;/p&gt;
&lt;p&gt;The final release, &lt;strong&gt;3.14.0&lt;/strong&gt;, is scheduled for &lt;strong&gt;October 7&lt;/strong&gt;. Check out Real Python’s series about the new features you can look forward to in &lt;a href=&quot;https://realpython.com/search?kind=article&amp;amp;q=python+3.14+preview&quot;&gt;Python 3.14&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&quot;django-60-alpha-released&quot;&gt;Django 6.0 Alpha Released&lt;a class=&quot;headerlink&quot; href=&quot;#django-60-alpha-released&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://www.djangoproject.com/weblog/2025/sep/17/django-60-alpha-released/&quot;&gt;Django 6.0 alpha 1&lt;/a&gt; is out! This first public preview gives early access to the upcoming features in &lt;a href=&quot;https://realpython.com/learning-paths/django-web-development/&quot;&gt;Django’s&lt;/a&gt; next major version. Although not production-ready, the alpha includes significant internal updates and deprecations, setting the stage for future capabilities.&lt;/p&gt;
&lt;p&gt;Some of the early changes include enhanced &lt;a href=&quot;https://realpython.com/async-io-python/&quot;&gt;async&lt;/a&gt; support, continued cleanup of old APIs, and the groundwork for upcoming improvements in database backend integration. Now is a great time for Django developers to test their apps and provide feedback before Django 6.0 is finalized.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://www.djangoproject.com/weblog/2025/sep/03/security-releases/&quot;&gt;Django 5.2.6, 5.1.12, and 4.2.24&lt;/a&gt; were released separately with important security fixes. If you maintain Django applications, then these updates are strongly recommended.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-news-october-2025/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-news-october-2025/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #268: Advice on Beginning to Learn Python</title>
      <id>https://realpython.com/podcasts/rpp/268/</id>
      <link href="https://realpython.com/podcasts/rpp/268/"/>
      <updated>2025-10-03T12:00:00+00:00</updated>
      <summary>What&#x27;s changed about learning Python over the last few years? What new techniques and updated advice should beginners have as they start their journey? This week on the show, Stephen Gruppetta and Martin Breuss return to discuss beginning to learn Python.</summary>
      <content type="html">
        &lt;p&gt;What&#x27;s changed about learning Python over the last few years? What new techniques and updated advice should beginners have as they start their journey? This week on the show, Stephen Gruppetta and Martin Breuss return to discuss beginning to learn Python.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Python 3.14 Preview: Better Syntax Error Messages</title>
      <id>https://realpython.com/python314-error-messages/</id>
      <link href="https://realpython.com/python314-error-messages/"/>
      <updated>2025-10-01T14:00:00+00:00</updated>
      <summary>Python 3.14 includes ten improvements to error messages, which help you catch common coding mistakes and point you in the right direction.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Python 3.14 brings a fresh batch of improvements to error messages that’ll make debugging feel less like detective work and more like having a helpful colleague point out exactly what went wrong. These refinements build on the clearer tracebacks introduced in recent releases and focus on the mistakes Python programmers make most often.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this tutorial, you’ll understand that:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Python 3.14’s improved error messages&lt;/strong&gt; help you debug code more efficiently.&lt;/li&gt;
&lt;li&gt;There are &lt;strong&gt;ten error message enhancements&lt;/strong&gt; in 3.14 that cover common mistakes, from keyword typos to misusing &lt;code&gt;async with&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;These improvements can help you catch &lt;strong&gt;common coding mistakes&lt;/strong&gt; faster.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Python’s error messages&lt;/strong&gt; have evolved from version 3.10 through 3.14.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Better error messages&lt;/strong&gt; accelerate your learning and development process.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There are many other improvements and new features coming in &lt;strong&gt;Python 3.14&lt;/strong&gt;. The highlights include the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://realpython.com/python-t-strings/&quot;&gt;Template Strings (T-Strings)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://realpython.com/python-annotations/&quot;&gt;Lazy Annotations&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://realpython.com/python-repl-autocompletion-highlighting/&quot;&gt;REPL Autocompletion and Highlighting&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To try any of the examples in this tutorial, you need to use Python 3.14. The tutorials &lt;a href=&quot;https://realpython.com/installing-python/&quot;&gt;How to Install Python on Your System: A Guide&lt;/a&gt; and &lt;a href=&quot;https://realpython.com/intro-to-pyenv/&quot;&gt;Managing Multiple Python Versions With pyenv&lt;/a&gt; walk you through several options for adding a new version of Python to your system.&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown&gt;Get Your Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python314-error-messages-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python314-error-messages-code&quot; markdown&gt;Click here to download the free sample code&lt;/a&gt; that you’ll use to learn about the error message improvements in Python 3.14.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;container border rounded text-wrap-pretty my-3&quot;&gt;

  &lt;p class=&quot;my-3&quot;&gt;&lt;mark class=&quot;marker-highlight&quot;&gt;&lt;strong&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt; Take the Quiz:&lt;/strong&gt;&lt;/mark&gt; Test your knowledge with our interactive “Python 3.14 Preview: Better Syntax Error Messages” quiz. You’ll receive a score upon completion to help you track your learning progress:&lt;/p&gt;

  &lt;hr&gt;

  &lt;div class=&quot;row my-3&quot;&gt;
    &lt;div class=&quot;col-xs-12 col-sm-4 col-md-3 align-self-center&quot;&gt;

      &lt;a href=&quot;/quizzes/python314-error-messages/&quot; tabindex=&quot;-1&quot;&gt;
        &lt;div class=&quot;embed-responsive embed-responsive-16by9&quot;&gt;

            &lt;img class=&quot;card-img-top m-0 p-0 embed-responsive-item rounded&quot; style=&quot;object-fit: contain; background: #abe5b2;&quot; alt=&quot;Python 3.14 Preview: Better Syntax Error Messages&quot; src=&quot;https://files.realpython.com/media/Python-3.14-Preview-Better-Syntax-Error-Messages_Watarmarked.ac1b2c644591.jpg&quot; width=&quot;1920&quot; height=&quot;1080&quot; srcset=&quot;/cdn-cgi/image/width=480,format=auto/https://files.realpython.com/media/Python-3.14-Preview-Better-Syntax-Error-Messages_Watarmarked.ac1b2c644591.jpg 480w, /cdn-cgi/image/width=640,format=auto/https://files.realpython.com/media/Python-3.14-Preview-Better-Syntax-Error-Messages_Watarmarked.ac1b2c644591.jpg 640w, /cdn-cgi/image/width=960,format=auto/https://files.realpython.com/media/Python-3.14-Preview-Better-Syntax-Error-Messages_Watarmarked.ac1b2c644591.jpg 960w, /cdn-cgi/image/width=1920,format=auto/https://files.realpython.com/media/Python-3.14-Preview-Better-Syntax-Error-Messages_Watarmarked.ac1b2c644591.jpg 1920w&quot; sizes=&quot;(min-width: 1200px) 142px, (min-width: 1000px) 122px, (min-width: 780px) 112px, (min-width: 580px) 139px, calc(100vw - 62px)&quot;&gt;


          &lt;div class=&quot;card-img-overlay d-flex align-items-center&quot;&gt;
            &lt;div class=&quot;mx-auto&quot;&gt;
              &lt;span class=&quot;text-light&quot; style=&quot;opacity: 0.90;&quot;&gt;&lt;span class=&quot;icon baseline scale2x&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/a&gt;

    &lt;/div&gt;
    &lt;div class=&quot;col&quot;&gt;
      &lt;div class=&quot;mt-3 d-md-none&quot;&gt;&lt;/div&gt; 
      &lt;p class=&quot;small text-muted mb-0&quot;&gt;&lt;strong&gt;Interactive Quiz&lt;/strong&gt;&lt;/p&gt;
      &lt;a href=&quot;/quizzes/python314-error-messages/&quot; class=&quot;stretched-link&quot;&gt;&lt;span class=&quot;my-0 h4&quot;&gt;Python 3.14 Preview: Better Syntax Error Messages&lt;/span&gt;&lt;/a&gt; 
      &lt;p class=&quot;text-muted mb-0 small&quot;&gt;Explore how Python 3.14 improves error messages with clearer explanations, actionable hints, and better debugging support for developers.&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;

&lt;/div&gt;

&lt;h2 id=&quot;better-error-messages-in-python-314&quot;&gt;Better Error Messages in Python 3.14&lt;a class=&quot;headerlink&quot; href=&quot;#better-error-messages-in-python-314&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;When Python 3.9 introduced a new &lt;a href=&quot;https://docs.python.org/3/whatsnew/3.9.html#new-parser&quot;&gt;parsing expression grammar (PEG)&lt;/a&gt; parser for the language, it opened the door to &lt;a href=&quot;https://realpython.com/python310-new-features/#better-error-messages&quot;&gt;better error messages in Python 3.10&lt;/a&gt;. Python 3.11 followed with &lt;a href=&quot;https://realpython.com/python311-error-messages/&quot;&gt;even better error messages&lt;/a&gt;, and that same effort continued in &lt;a href=&quot;https://realpython.com/python312-error-messages/&quot;&gt;Python 3.12&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://realpython.com/python313-new-features/#better-error-messages&quot;&gt;Python 3.13&lt;/a&gt; refined these messages further with improved formatting and clearer explanations, making multiline errors more readable and adding context to complex error situations. These improvements build upon &lt;a href=&quot;https://peps.python.org/pep-0657/&quot;&gt;PEP 657&lt;/a&gt;, which introduced fine-grained error locations in tracebacks in Python 3.11.&lt;/p&gt;
&lt;p&gt;Now, Python 3.14 takes another step forward, alongside other significant changes like &lt;a href=&quot;https://peps.python.org/pep-0779/&quot;&gt;PEP 779&lt;/a&gt;, which makes the &lt;a href=&quot;https://realpython.com/python313-free-threading-jit/&quot;&gt;free-threaded build&lt;/a&gt; officially supported, and &lt;a href=&quot;https://peps.python.org/pep-0765/&quot;&gt;PEP 765&lt;/a&gt;, which disallows using &lt;code&gt;return&lt;/code&gt;, &lt;code&gt;break&lt;/code&gt;, or &lt;code&gt;continue&lt;/code&gt; to exit a &lt;code&gt;finally&lt;/code&gt; block. What makes the error message enhancements in Python 3.14 special is their focus on common mistakes. &lt;/p&gt;
&lt;p&gt;Each improved error message follows a consistent pattern:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;It identifies the mistake.&lt;/li&gt;
&lt;li&gt;It explains what’s wrong in plain English.&lt;/li&gt;
&lt;li&gt;It suggests a likely fix when possible.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The error message improvements in Python 3.14 cover &lt;a href=&quot;/ref/builtin-exceptions/syntaxerror/&quot; class=&quot;ref-link&quot;&gt;&lt;code&gt;SyntaxError&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;/ref/builtin-exceptions/valueerror/&quot; class=&quot;ref-link&quot;&gt;&lt;code&gt;ValueError&lt;/code&gt;&lt;/a&gt;, and &lt;a href=&quot;/ref/builtin-exceptions/typeerror/&quot; class=&quot;ref-link&quot;&gt;&lt;code&gt;TypeError&lt;/code&gt;&lt;/a&gt; messages. For an overview of the ten improvements you’ll explore in this tutorial, expand the collapsible section below:&lt;/p&gt;
&lt;div class=&quot;card mb-3&quot; id=&quot;collapse_card3bde0f&quot;&gt;
&lt;div class=&quot;card-header border-0&quot;&gt;
&lt;p class=&quot;m-0&quot;&gt;
    &lt;button class=&quot;btn w-100&quot; data-toggle=&quot;collapse&quot; data-target=&quot;#collapse3bde0f&quot; aria-expanded=&quot;false&quot; aria-controls=&quot;collapse3bde0f&quot; markdown=&quot;1&quot;&gt;&lt;span class=&quot;float-left&quot; markdown=&quot;1&quot;&gt;Error Message Improvements in Python 3.14: A Quick Summary&lt;/span&gt;&lt;span class=&quot;float-right text-muted&quot;&gt;Show/Hide&lt;/span&gt;&lt;/button&gt;
  &lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;collapse js-collapsible-section&quot; data-parent=&quot;#collapse_card3bde0f&quot; id=&quot;collapse3bde0f&quot;&gt;
&lt;div class=&quot;card-body&quot;&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Keyword Typos&lt;/strong&gt; — &lt;code&gt;SyntaxError&lt;/code&gt;&lt;br&gt;
  ⭕️ &lt;strong&gt;Previous:&lt;/strong&gt; &lt;code&gt;invalid syntax&lt;/code&gt;&lt;br&gt;
  ✅ &lt;strong&gt;Improved:&lt;/strong&gt; &lt;code&gt;invalid syntax. Did you mean &#x27;for&#x27;?&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;elif&lt;/code&gt; After &lt;code&gt;else&lt;/code&gt;&lt;/strong&gt; — &lt;code&gt;SyntaxError&lt;/code&gt;&lt;br&gt;
  ⭕️ &lt;strong&gt;Previous:&lt;/strong&gt; &lt;code&gt;invalid syntax&lt;/code&gt;&lt;br&gt;
  ✅ &lt;strong&gt;Improved:&lt;/strong&gt; &lt;code&gt;&#x27;elif&#x27; block follows an &#x27;else&#x27; block&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Conditional Expressions&lt;/strong&gt; — &lt;code&gt;SyntaxError&lt;/code&gt;&lt;br&gt;
  ⭕️ &lt;strong&gt;Previous:&lt;/strong&gt; &lt;code&gt;invalid syntax&lt;/code&gt;&lt;br&gt;
  ✅ &lt;strong&gt;Improved:&lt;/strong&gt; &lt;code&gt;expected expression after &#x27;else&#x27;, but statement is given&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;String Closure&lt;/strong&gt; — &lt;code&gt;SyntaxError&lt;/code&gt;&lt;br&gt;
  ⭕️ &lt;strong&gt;Previous:&lt;/strong&gt; &lt;code&gt;invalid syntax&lt;/code&gt;&lt;br&gt;
  ✅ &lt;strong&gt;Improved:&lt;/strong&gt; &lt;code&gt;invalid syntax. Is this intended to be part of the string?&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;String Prefixes&lt;/strong&gt; — &lt;code&gt;SyntaxError&lt;/code&gt;&lt;br&gt;
  ⭕️ &lt;strong&gt;Previous:&lt;/strong&gt; &lt;code&gt;invalid syntax&lt;/code&gt;&lt;br&gt;
  ✅ &lt;strong&gt;Improved:&lt;/strong&gt; &lt;code&gt;&#x27;b&#x27; and &#x27;f&#x27; prefixes are incompatible&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Unpacking Errors&lt;/strong&gt; — &lt;code&gt;ValueError&lt;/code&gt;&lt;br&gt;
  ⭕️ &lt;strong&gt;Previous:&lt;/strong&gt; &lt;code&gt;too many values to unpack (expected 2)&lt;/code&gt;&lt;br&gt;
  ✅ &lt;strong&gt;Improved:&lt;/strong&gt; &lt;code&gt;too many values to unpack (expected 2, got 3)&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;as&lt;/code&gt; Targets&lt;/strong&gt; — &lt;code&gt;SyntaxError&lt;/code&gt;&lt;br&gt;
  ⭕️ &lt;strong&gt;Previous:&lt;/strong&gt; &lt;code&gt;invalid syntax&lt;/code&gt;&lt;br&gt;
  ✅ &lt;strong&gt;Improved:&lt;/strong&gt; &lt;code&gt;cannot use list as import target&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Unhashable Types&lt;/strong&gt; — &lt;code&gt;TypeError&lt;/code&gt;&lt;br&gt;
  ⭕️ &lt;strong&gt;Previous:&lt;/strong&gt; &lt;code&gt;unhashable type: &#x27;list&#x27;&lt;/code&gt;&lt;br&gt;
  ✅ &lt;strong&gt;Improved:&lt;/strong&gt; &lt;code&gt;cannot use &#x27;list&#x27; as a dict key (unhashable type: &#x27;list&#x27;)&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;math&lt;/code&gt; Domain Errors&lt;/strong&gt; — &lt;code&gt;ValueError&lt;/code&gt;&lt;br&gt;
  ⭕️ &lt;strong&gt;Previous:&lt;/strong&gt; &lt;code&gt;math domain error&lt;/code&gt;&lt;br&gt;
  ✅ &lt;strong&gt;Improved:&lt;/strong&gt; &lt;code&gt;expected a nonnegative input, got -1.0&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;async with&lt;/code&gt; Errors&lt;/strong&gt; — &lt;code&gt;TypeError&lt;/code&gt;&lt;br&gt;
  ⭕️ &lt;strong&gt;Previous:&lt;/strong&gt; &lt;code&gt;&#x27;TaskGroup&#x27; object does not support the context manager protocol&lt;/code&gt;&lt;br&gt;
  ✅ &lt;strong&gt;Improved:&lt;/strong&gt; &lt;code&gt;object does not support the context manager protocol...Did you mean to use &#x27;async with&#x27;?&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The examples in this tutorial show both the error messages from Python 3.13 and the improved messages in Python 3.14, so you can see the differences even if you haven’t installed 3.14 yet.&lt;/p&gt;
&lt;p&gt;For a general overview of Python’s exception system, see &lt;a href=&quot;https://realpython.com/python-built-in-exceptions/&quot;&gt;Python’s Built-in Exceptions: A Walkthrough With Examples&lt;/a&gt;, or to learn about raising exceptions, check out &lt;a href=&quot;https://realpython.com/python-raise-exception/&quot;&gt;Python’s raise: Effectively Raising Exceptions in Your Code&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&quot;clearer-keyword-typo-suggestions&quot;&gt;Clearer Keyword Typo Suggestions&lt;a class=&quot;headerlink&quot; href=&quot;#clearer-keyword-typo-suggestions&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A typo is usually a tiny mistake, sometimes just one extra letter, but it’s enough to break your code completely. Typos that involve &lt;a href=&quot;https://realpython.com/python-keywords/&quot;&gt;Python keywords&lt;/a&gt; are among the most common &lt;a href=&quot;https://realpython.com/python-exceptions/#syntax-errors&quot;&gt;syntax errors&lt;/a&gt; in Python code.&lt;/p&gt;
&lt;p&gt;In Python 3.13 and earlier, a typo in a keyword produces a generic syntax error that offers no guidance about what might be wrong:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;pycon&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--blue&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Python&lt;/span&gt;
    &lt;span class=&quot;mr-2&quot; aria-label=&quot;Filename&quot;&gt;&lt;code style=&quot;color: inherit; background: inherit;&quot;&gt;Python 3.13&lt;/code&gt;&lt;/span&gt;
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; role=&quot;button&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;forr&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;range&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
  File &lt;span class=&quot;nb&quot;&gt;&quot;&amp;lt;python-input-0&amp;gt;&quot;&lt;/span&gt;, line &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;forr&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;range&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;         &lt;/span&gt;&lt;span class=&quot;pm&quot;&gt;^&lt;/span&gt;
&lt;span class=&quot;gr&quot;&gt;SyntaxError&lt;/span&gt;: &lt;span class=&quot;n&quot;&gt;invalid syntax&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;The error points to the problem area with a helpful caret symbol (&lt;code&gt;^&lt;/code&gt;), which at least tells you where Python found the error. However, it doesn’t suggest what you might have meant. The message “invalid syntax” is technically correct but not particularly helpful in practice. &lt;/p&gt;
&lt;p&gt;You have to figure out on your own that &lt;code&gt;forr&lt;/code&gt; should actually be &lt;code&gt;for&lt;/code&gt;. It might be obvious once you spot it, but finding that single wrong letter can take a surprisingly long time when you’re focused on logic rather than spelling.&lt;/p&gt;
&lt;p&gt;Python 3.14 recognizes when you type something close to a &lt;a href=&quot;/ref/keywords/&quot; class=&quot;ref-link&quot;&gt;Python keyword&lt;/a&gt; and offers a helpful suggestion that immediately points you to the fix:&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python314-error-messages/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python314-error-messages/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Quiz: Python 3.14 Preview: Better Syntax Error Messages</title>
      <id>https://realpython.com/quizzes/python314-error-messages/</id>
      <link href="https://realpython.com/quizzes/python314-error-messages/"/>
      <updated>2025-10-01T12:00:00+00:00</updated>
      <summary>Explore how Python 3.14 improves error messages with clearer explanations, actionable hints, and better debugging support for developers.</summary>
      <content type="html">
        &lt;p&gt;This quiz helps you get familiar with the upgraded error messages in &lt;a href=&quot;https://realpython.com/python314-error-messages/&quot;&gt;Python 3.14&lt;/a&gt;. You&amp;rsquo;ll review new keyword typo suggestions, improved math errors, string prefix feedback, and more.&lt;/p&gt;
&lt;p&gt;Put your understanding to the test and discover how Python&amp;rsquo;s improved error messages can help you debug code faster.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Quiz: Python MCP Server: Connect LLMs to Your Data</title>
      <id>https://realpython.com/quizzes/python-mcp/</id>
      <link href="https://realpython.com/quizzes/python-mcp/"/>
      <updated>2025-10-01T12:00:00+00:00</updated>
      <summary>Test your knowledge of Python MCP. Practice installation, tools, resources, transports, and how LLMs interact with MCP servers.</summary>
      <content type="html">
        &lt;p&gt;This quiz helps you review the core ideas behind the Model Context Protocol (MCP). You will practice how MCP connects large language models with external systems, how to install it, and what role prompts, resources, and tools play.&lt;/p&gt;
&lt;p&gt;You&amp;rsquo;ll also revisit best practices for defining tools, explore client-server setups like Cursor, and check your understanding of transports and testing. For a full walkthrough, see &lt;a href=&quot;https://realpython.com/python-mcp/&quot;&gt;Python MCP Server: Connect LLMs to Your Data&lt;/a&gt;.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Modern Python Linting With Ruff</title>
      <id>https://realpython.com/courses/modern-python-linting-ruff/</id>
      <link href="https://realpython.com/courses/modern-python-linting-ruff/"/>
      <updated>2025-09-30T14:00:00+00:00</updated>
      <summary>Ruff is a blazing-fast, modern Python linter with a simple interface that can replace Pylint, isort, and Black—and it&#x27;s rapidly becoming popular.</summary>
      <content type="html">
        &lt;p&gt;Linting is essential to writing &lt;strong&gt;clean and readable code&lt;/strong&gt; that you can share with others. A linter, like Ruff, is a tool that analyzes your code and looks for errors, stylistic issues, and suspicious constructs. Linting allows you to address issues and &lt;a href=&quot;https://realpython.com/python-code-quality/&quot;&gt;improve your code quality&lt;/a&gt; before you &lt;a href=&quot;https://realpython.com/python-git-github-intro/#committing-changes&quot;&gt;commit&lt;/a&gt; your code and share it with others. &lt;/p&gt;
&lt;p&gt;Ruff is a modern linter that&amp;rsquo;s extremely fast and has a simple interface, making it straightforward to use. It also aims to be a drop-in replacement for many other linting and formatting tools, such as &lt;a href=&quot;https://github.com/PyCQA/flake8&quot;&gt;Flake8&lt;/a&gt;, &lt;a href=&quot;https://github.com/PyCQA/isort&quot;&gt;isort&lt;/a&gt;, and &lt;a href=&quot;https://github.com/psf/black&quot;&gt;Black&lt;/a&gt;. It&amp;rsquo;s quickly becoming one of the most popular Python linters.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this video course, you&amp;rsquo;ll learn how to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Install &lt;strong&gt;Ruff&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Check your Python code&lt;/strong&gt; for errors&lt;/li&gt;
&lt;li&gt;Automatically &lt;strong&gt;fix your linting errors&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Use Ruff to &lt;strong&gt;format your code&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Add optional configurations&lt;/strong&gt; to supercharge your linting&lt;/li&gt;
&lt;/ul&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Quiz: Modern Python Linting With Ruff</title>
      <id>https://realpython.com/quizzes/modern-python-linting-ruff/</id>
      <link href="https://realpython.com/quizzes/modern-python-linting-ruff/"/>
      <updated>2025-09-30T12:00:00+00:00</updated>
      <summary>Test your Ruff skills in a quick quiz. Practice installation checks, continuous linting, formatting, rule selection, auto-fixes, and config.</summary>
      <content type="html">
        &lt;p&gt;Sharpen your code quality workflow with Ruff. In this quiz, you&amp;rsquo;ll review installation checks, continuous linting, and code formatting.&lt;/p&gt;
&lt;p&gt;You&amp;rsquo;ll also revisit selecting rule codes, reading rule docs, applying safe fixes, and configuring TOML files. For a refresher, see &lt;a href=&quot;https://realpython.com/courses/modern-python-linting-ruff/&quot;&gt;Modern Python Linting With Ruff&lt;/a&gt;.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Astral&#x27;s ty: A New Blazing-Fast Type Checker for Python</title>
      <id>https://realpython.com/python-ty/</id>
      <link href="https://realpython.com/python-ty/"/>
      <updated>2025-09-29T14:00:00+00:00</updated>
      <summary>Learn to use ty, an ultra-fast Python type checker written in Rust. Get setup instructions, run type checks, and fine-tune custom rules in personal projects.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;After Ruff and uv, the Astral team is back with another Rust-based tool called ty, short for &lt;em&gt;type check&lt;/em&gt;. This new tool delivers a lightning-fast static type-checking experience in Python, aiming to outpace existing tools in both performance and convenience. By incorporating ty into your daily workflow, you’ll catch type-related bugs earlier and get clearer feedback.&lt;/p&gt;
&lt;p&gt;But is ty suitable for you? Take a look at the table below to make a quick decision:&lt;/p&gt;
&lt;div class=&quot;table-responsive&quot;&gt;
&lt;table class=&quot;table table-hover&quot;&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Use Case&lt;/th&gt;
&lt;th&gt;Pick &lt;code&gt;ty&lt;/code&gt;&lt;/th&gt;
&lt;th&gt;Pick Other Tools&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Development or experimentation&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Production use&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;At the time of writing, &lt;a href=&quot;https://github.com/astral-sh/ty&quot;&gt;ty&lt;/a&gt; is available as an early &lt;strong&gt;preview release&lt;/strong&gt; with hundreds of &lt;a href=&quot;https://github.com/astral-sh/ty/issues&quot;&gt;open issues&lt;/a&gt;. Despite being actively developed and boasting over ten thousand &lt;a href=&quot;https://github.com/astral-sh/ty/stargazers&quot;&gt;stars on GitHub&lt;/a&gt;, it’s still missing essential features and might occasionally fail.&lt;/p&gt;
&lt;p&gt;As such, it’s not ready for full adoption in production yet, nor is it going to be a drop-in replacement for any of its competitors. Bugs can take you by surprise in unexpected ways! Additionally, because ty’s implementation is moving fast, some of the information you’ll find in this tutorial may become outdated over time.&lt;/p&gt;
&lt;p&gt;If you’d like to get familiar with a new, robust, and promising type checker in your personal projects, then by all means give ty a try! Ready to dive in? Click the link below to grab the sample code you’ll be working with in this tutorial:&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown&gt;Get Your Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-ty-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-ty-code&quot; markdown&gt;Click here to download the free sample code&lt;/a&gt; that you’ll use to learn about Astral’s ty.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;container border rounded text-wrap-pretty my-3&quot;&gt;

  &lt;p class=&quot;my-3&quot;&gt;&lt;mark class=&quot;marker-highlight&quot;&gt;&lt;strong&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt; Take the Quiz:&lt;/strong&gt;&lt;/mark&gt; Test your knowledge with our interactive “Astral&#x27;s ty Type Checker for Python” quiz. You’ll receive a score upon completion to help you track your learning progress:&lt;/p&gt;

  &lt;hr&gt;

  &lt;div class=&quot;row my-3&quot;&gt;
    &lt;div class=&quot;col-xs-12 col-sm-4 col-md-3 align-self-center&quot;&gt;

      &lt;a href=&quot;/quizzes/python-ty/&quot; tabindex=&quot;-1&quot;&gt;
        &lt;div class=&quot;embed-responsive embed-responsive-16by9&quot;&gt;

            &lt;img class=&quot;card-img-top m-0 p-0 embed-responsive-item rounded&quot; style=&quot;object-fit: contain; background: #e5c6aa;&quot; alt=&quot;Astral&#x27;s ty: A New Blazing-Fast Type Checker for Python&quot; src=&quot;https://files.realpython.com/media/ty-A-Fast-Python-Type-Checker.5b9b718767ed.jpg&quot; width=&quot;1920&quot; height=&quot;1080&quot; srcset=&quot;/cdn-cgi/image/width=480,format=auto/https://files.realpython.com/media/ty-A-Fast-Python-Type-Checker.5b9b718767ed.jpg 480w, /cdn-cgi/image/width=640,format=auto/https://files.realpython.com/media/ty-A-Fast-Python-Type-Checker.5b9b718767ed.jpg 640w, /cdn-cgi/image/width=960,format=auto/https://files.realpython.com/media/ty-A-Fast-Python-Type-Checker.5b9b718767ed.jpg 960w, /cdn-cgi/image/width=1920,format=auto/https://files.realpython.com/media/ty-A-Fast-Python-Type-Checker.5b9b718767ed.jpg 1920w&quot; sizes=&quot;(min-width: 1200px) 142px, (min-width: 1000px) 122px, (min-width: 780px) 112px, (min-width: 580px) 139px, calc(100vw - 62px)&quot;&gt;


          &lt;div class=&quot;card-img-overlay d-flex align-items-center&quot;&gt;
            &lt;div class=&quot;mx-auto&quot;&gt;
              &lt;span class=&quot;text-light&quot; style=&quot;opacity: 0.90;&quot;&gt;&lt;span class=&quot;icon baseline scale2x&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/a&gt;

    &lt;/div&gt;
    &lt;div class=&quot;col&quot;&gt;
      &lt;div class=&quot;mt-3 d-md-none&quot;&gt;&lt;/div&gt; 
      &lt;p class=&quot;small text-muted mb-0&quot;&gt;&lt;strong&gt;Interactive Quiz&lt;/strong&gt;&lt;/p&gt;
      &lt;a href=&quot;/quizzes/python-ty/&quot; class=&quot;stretched-link&quot;&gt;&lt;span class=&quot;my-0 h4&quot;&gt;Astral&#x27;s ty Type Checker for Python&lt;/span&gt;&lt;/a&gt; 
      &lt;p class=&quot;text-muted mb-0 small&quot;&gt;Test your knowledge of Astral&#x27;s ty—a blazing-fast, Rust-powered Python type checker. You&#x27;ll cover installation, usage, rule configuration, and the tool&#x27;s current limitations.&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;

&lt;/div&gt;

&lt;h2 id=&quot;start-using-ty-in-python-now&quot;&gt;Start Using ty in Python Now&lt;a class=&quot;headerlink&quot; href=&quot;#start-using-ty-in-python-now&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Python is a dynamically typed language, so it requires third-party tools to perform &lt;a href=&quot;https://realpython.com/python-type-checking/&quot;&gt;type checking&lt;/a&gt; and other kinds of &lt;a href=&quot;https://en.wikipedia.org/wiki/Static_program_analysis&quot;&gt;static code analysis&lt;/a&gt;. Recently, &lt;a href=&quot;https://github.com/astral-sh/ty&quot;&gt;ty&lt;/a&gt; joined the club of external type-checking tools for Python. Despite being created by a private company, &lt;a href=&quot;https://astral.sh/&quot;&gt;Astral&lt;/a&gt;, the tool itself remains open source and MIT-licensed.&lt;/p&gt;
&lt;p&gt;Although ty is mostly written in &lt;a href=&quot;https://www.rust-lang.org/&quot;&gt;Rust&lt;/a&gt;, you don’t need the Rust compiler or its execution environment to type check your Python projects with it. To quickly get started with ty, you can install it directly from &lt;a href=&quot;/ref/glossary/pypi/&quot; class=&quot;ref-link&quot;&gt;PyPI&lt;/a&gt; with &lt;a href=&quot;/ref/glossary/pip/&quot; class=&quot;ref-link&quot;&gt;&lt;code&gt;pip&lt;/code&gt;&lt;/a&gt;, preferably within an activated &lt;a href=&quot;/ref/glossary/virtual-environment/&quot; class=&quot;ref-link&quot;&gt;virtual environment&lt;/a&gt;:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;console&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--yellow&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Shell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; role=&quot;button&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp gp-VirtualEnv&quot;&gt;(venv)&lt;/span&gt; &lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;python&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;-m&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;pip&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;install&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;ty
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;As long as you’re on one of the three major operating systems—Windows, macOS, or Linux—this command will bring a hefty binary script called &lt;code&gt;ty&lt;/code&gt; into your virtual environment. The script is already compiled to &lt;a href=&quot;https://en.wikipedia.org/wiki/Machine_code&quot;&gt;machine code&lt;/a&gt; suitable for your platform with all the necessary dependencies baked in, so you can run it directly, just like any other command-line program.&lt;/p&gt;
&lt;p&gt;To verify the installation, run the following command in your &lt;a href=&quot;https://realpython.com/terminal-commands/&quot;&gt;terminal emulator&lt;/a&gt; app:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;console&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--yellow&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Shell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; role=&quot;button&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp gp-VirtualEnv&quot;&gt;(venv)&lt;/span&gt; &lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;ty&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;--version
&lt;span class=&quot;go&quot;&gt;ty 0.0.1-alpha.21&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;You should see a version number similar to the one above appear in the output. Alternatively, if that doesn’t work, then try to execute &lt;code&gt;ty&lt;/code&gt; as a Python module using the interpreter’s &lt;code&gt;-m&lt;/code&gt; option:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;console&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--yellow&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Shell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; role=&quot;button&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp gp-VirtualEnv&quot;&gt;(venv)&lt;/span&gt; &lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;python&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;-m&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;ty&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;--version
&lt;span class=&quot;go&quot;&gt;ty 0.0.1-alpha.21&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;When you do, Python runs a tiny &lt;a href=&quot;https://github.com/astral-sh/ty/blob/main/python/ty/__main__.py&quot;&gt;wrapper script&lt;/a&gt; that looks for the &lt;code&gt;ty&lt;/code&gt; binary executable in your path and invokes it for you.&lt;/p&gt;
&lt;p&gt;Note that the &lt;code&gt;pip&lt;/code&gt; install command only installs ty into the given virtual environment, which is usually associated with a specific project. To make ty available globally from any folder on your computer, you’ll need to use a different approach. Check out the &lt;a href=&quot;https://docs.astral.sh/ty/installation/&quot;&gt;official documentation&lt;/a&gt; for more installation options.&lt;/p&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; If &lt;a href=&quot;https://realpython.com/python-development-visual-studio-code/&quot;&gt;Visual Studio Code&lt;/a&gt; is your &lt;a href=&quot;https://realpython.com/python-ides-code-editors-guide/&quot;&gt;code editor&lt;/a&gt; of choice, then you’ll benefit from installing the official &lt;a href=&quot;https://github.com/astral-sh/ty-vscode&quot;&gt;ty extension&lt;/a&gt;. This extension integrates ty directly into VS Code, letting you work without ever touching the command line. Unfortunately, users of &lt;a href=&quot;https://realpython.com/pycharm-guide/&quot;&gt;PyCharm&lt;/a&gt; and other popular IDEs must wait until plugins for their tools catch up.&lt;/p&gt;
&lt;p&gt;If your editor supports the &lt;a href=&quot;https://en.wikipedia.org/wiki/Language_Server_Protocol&quot;&gt;Language Server Protocol&lt;/a&gt;, then you could leverage the &lt;a href=&quot;https://docs.astral.sh/ty/reference/cli/#ty-server&quot;&gt;&lt;code&gt;ty server&lt;/code&gt;&lt;/a&gt; subcommand. For PyCharm, this requires installing the &lt;a href=&quot;https://plugins.jetbrains.com/plugin/23257-lsp4ij&quot;&gt;LSP4IJ plugin&lt;/a&gt; first, though this tutorial won’t cover its configuration.&lt;/p&gt;
&lt;p&gt;Finally, if none of this works for you, then you may want to run the &lt;code&gt;ty check&lt;/code&gt; subcommand with the optional &lt;a href=&quot;https://docs.astral.sh/ty/reference/cli/#ty-check--watch&quot;&gt;&lt;code&gt;--watch&lt;/code&gt;&lt;/a&gt; switch. This will have ty automatically rerun the checks for instant feedback whenever changes are detected upon saving one of the files in your project.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;From now on, you won’t see the virtual environment’s name (&lt;code&gt;venv&lt;/code&gt;) in the command prompts for the rest of this tutorial. To keep the code blocks concise, it’ll be assumed that ty is already installed globally and available in your system’s path.&lt;/p&gt;
&lt;p&gt;Alright. It’s time for the fun part: letting ty scrutinize some Python code to catch bugs before they sneak in.&lt;/p&gt;
&lt;h2 id=&quot;catch-typing-errors-with-ty&quot;&gt;Catch Typing Errors With ty&lt;a class=&quot;headerlink&quot; href=&quot;#catch-typing-errors-with-ty&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The &lt;a href=&quot;https://docs.astral.sh/ty/reference/cli/&quot;&gt;command-line interface of ty&lt;/a&gt; is pretty minimal and straightforward, as you’ll notice when you run &lt;code&gt;ty&lt;/code&gt; without providing any subcommands or options:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;console&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--yellow&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Shell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; role=&quot;button&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;ty
&lt;span class=&quot;go&quot;&gt;An extremely fast Python type checker.&lt;/span&gt;

&lt;span class=&quot;go&quot;&gt;Usage: ty &amp;lt;COMMAND&amp;gt;&lt;/span&gt;

&lt;span class=&quot;go&quot;&gt;Commands:&lt;/span&gt;
&lt;span class=&quot;hll&quot;&gt;&lt;span class=&quot;go&quot;&gt;  check    Check a project for type errors&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;go&quot;&gt;  server   Start the language server&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  version  Display ty&#x27;s version&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  help     Print this message or the help of the given subcommand(s)&lt;/span&gt;

&lt;span class=&quot;go&quot;&gt;Options:&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  -h, --help     Print help&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  -V, --version  Print version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-ty/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-ty/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Quiz: Astral&#x27;s ty Type Checker for Python</title>
      <id>https://realpython.com/quizzes/python-ty/</id>
      <link href="https://realpython.com/quizzes/python-ty/"/>
      <updated>2025-09-29T12:00:00+00:00</updated>
      <summary>Test your knowledge of Astral&#x27;s ty—a blazing-fast, Rust-powered Python type checker. You&#x27;ll cover installation, usage, rule configuration, and the tool&#x27;s current limitations.</summary>
      <content type="html">
        &lt;p&gt;In this quiz, you&amp;rsquo;ll revisit the key concepts from &lt;a href=&quot;https://realpython.com/python-ty/&quot;&gt;Astral&amp;rsquo;s ty: A New Blazing-Fast Type Checker for Python&lt;/a&gt;. You&amp;rsquo;ll check your understanding of installing ty from PyPI, running type checks, and interpreting its structured diagnostics. You&amp;rsquo;ll also recall how to configure and silence specific rules, limit the scope of checks, and adjust Python version or platform settings.&lt;/p&gt;
&lt;p&gt;By completing this quiz, you&amp;rsquo;ll cement your ability to experiment confidently with ty in personal or exploratory projects.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #267: Managing Feature Flags &amp; Comparing Python Visualization Libraries</title>
      <id>https://realpython.com/podcasts/rpp/267/</id>
      <link href="https://realpython.com/podcasts/rpp/267/"/>
      <updated>2025-09-26T12:00:00+00:00</updated>
      <summary>What&#x27;s a good way to enable or disable code paths without redeploying the software? How can you use feature flags to toggle functionality for specific users of your application? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder&#x27;s Weekly articles and projects.</summary>
      <content type="html">
        &lt;p&gt;What&#x27;s a good way to enable or disable code paths without redeploying the software? How can you use feature flags to toggle functionality for specific users of your application? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder&#x27;s Weekly articles and projects.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Python MCP Server: Connect LLMs to Your Data</title>
      <id>https://realpython.com/python-mcp/</id>
      <link href="https://realpython.com/python-mcp/"/>
      <updated>2025-09-24T14:00:00+00:00</updated>
      <summary>Learn how to build a Model Context Protocol (MCP) server in Python. Connect tools, prompts, and data to AI agents like Cursor for smarter assistants.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;The Model Context Protocol (MCP) is a new open protocol that allows AI models to interact with external systems in a standardized, extensible way.  In this tutorial, you’ll install MCP, explore its client-server architecture, and work with its core concepts: prompts, resources, and tools. You’ll then build and test a Python MCP server that queries e-commerce data and integrate it with an AI agent in Cursor to see real tool calls in action.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this tutorial, you’ll understand:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What &lt;strong&gt;MCP&lt;/strong&gt; is and why it was created&lt;/li&gt;
&lt;li&gt;What MCP &lt;strong&gt;prompts&lt;/strong&gt;, &lt;strong&gt;resources&lt;/strong&gt;, and &lt;strong&gt;tools&lt;/strong&gt; are&lt;/li&gt;
&lt;li&gt;How to build an &lt;strong&gt;MCP server&lt;/strong&gt; with customized tools&lt;/li&gt;
&lt;li&gt;How to integrate your MCP server with &lt;strong&gt;AI agents&lt;/strong&gt; like &lt;strong&gt;Cursor&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You’ll get hands-on experience with Python MCP by creating and testing MCP servers and connecting your MCP to AI tools. To keep the focus on learning MCP rather than building a complex project, you’ll build a simple MCP server that interacts with a simulated e-commerce database. You’ll also use Cursor’s MCP client, which saves you from having to implement your own.&lt;/p&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; If you’re curious about further discussions on MCP, then listen to the Real Python Podcast &lt;a href=&quot;https://realpython.com/podcasts/rpp/266/&quot;&gt;Episode 266: Dangers of Automatically Converting a REST API to MCP&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;You’ll get the most out of this tutorial if you’re comfortable with intermediate Python concepts such as &lt;a href=&quot;https://realpython.com/defining-your-own-python-function/&quot;&gt;functions&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/python3-object-oriented-programming/&quot;&gt;object-oriented programming&lt;/a&gt;, and &lt;a href=&quot;https://realpython.com/async-io-python/&quot;&gt;asynchronous programming&lt;/a&gt;. It will also be helpful if you’re familiar with AI tools like &lt;a href=&quot;/ref/ai-coding-tools/chatgpt/&quot; class=&quot;ref-link&quot;&gt;ChatGPT&lt;/a&gt;, &lt;a href=&quot;/ref/ai-coding-tools/claude/&quot; class=&quot;ref-link&quot;&gt;Claude&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/build-llm-rag-chatbot-with-langchain/&quot;&gt;LangChain&lt;/a&gt;, and &lt;a href=&quot;/ref/ai-coding-tools/cursor/&quot; class=&quot;ref-link&quot;&gt;Cursor&lt;/a&gt;.&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown&gt;Get Your Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-mcp-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-mcp-code&quot; markdown&gt;Click here to download the free sample code&lt;/a&gt; that shows you how to use Python MCP to connect your LLM With the World.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;container border rounded text-wrap-pretty my-3&quot;&gt;

  &lt;p class=&quot;my-3&quot;&gt;&lt;mark class=&quot;marker-highlight&quot;&gt;&lt;strong&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt; Take the Quiz:&lt;/strong&gt;&lt;/mark&gt; Test your knowledge with our interactive “Python MCP Server: Connect LLMs to Your Data” quiz. You’ll receive a score upon completion to help you track your learning progress:&lt;/p&gt;

  &lt;hr&gt;

  &lt;div class=&quot;row my-3&quot;&gt;
    &lt;div class=&quot;col-xs-12 col-sm-4 col-md-3 align-self-center&quot;&gt;

      &lt;a href=&quot;/quizzes/python-mcp/&quot; tabindex=&quot;-1&quot;&gt;
        &lt;div class=&quot;embed-responsive embed-responsive-16by9&quot;&gt;

            &lt;img class=&quot;card-img-top m-0 p-0 embed-responsive-item rounded&quot; style=&quot;object-fit: contain; background: #abe0e6;&quot; alt=&quot;Python MCP: Connect Your LLM With the World&quot; src=&quot;https://files.realpython.com/media/How-to-Properly-Indent-Your-Python-Code_Watermarked.24ef559fc78a.jpg&quot; width=&quot;1920&quot; height=&quot;1080&quot; srcset=&quot;/cdn-cgi/image/width=480,format=auto/https://files.realpython.com/media/How-to-Properly-Indent-Your-Python-Code_Watermarked.24ef559fc78a.jpg 480w, /cdn-cgi/image/width=640,format=auto/https://files.realpython.com/media/How-to-Properly-Indent-Your-Python-Code_Watermarked.24ef559fc78a.jpg 640w, /cdn-cgi/image/width=960,format=auto/https://files.realpython.com/media/How-to-Properly-Indent-Your-Python-Code_Watermarked.24ef559fc78a.jpg 960w, /cdn-cgi/image/width=1920,format=auto/https://files.realpython.com/media/How-to-Properly-Indent-Your-Python-Code_Watermarked.24ef559fc78a.jpg 1920w&quot; sizes=&quot;(min-width: 1200px) 142px, (min-width: 1000px) 122px, (min-width: 780px) 112px, (min-width: 580px) 139px, calc(100vw - 62px)&quot;&gt;


          &lt;div class=&quot;card-img-overlay d-flex align-items-center&quot;&gt;
            &lt;div class=&quot;mx-auto&quot;&gt;
              &lt;span class=&quot;text-light&quot; style=&quot;opacity: 0.90;&quot;&gt;&lt;span class=&quot;icon baseline scale2x&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/a&gt;

    &lt;/div&gt;
    &lt;div class=&quot;col&quot;&gt;
      &lt;div class=&quot;mt-3 d-md-none&quot;&gt;&lt;/div&gt; 
      &lt;p class=&quot;small text-muted mb-0&quot;&gt;&lt;strong&gt;Interactive Quiz&lt;/strong&gt;&lt;/p&gt;
      &lt;a href=&quot;/quizzes/python-mcp/&quot; class=&quot;stretched-link&quot;&gt;&lt;span class=&quot;my-0 h4&quot;&gt;Python MCP Server: Connect LLMs to Your Data&lt;/span&gt;&lt;/a&gt; 
      &lt;p class=&quot;text-muted mb-0 small&quot;&gt;Test your knowledge of Python MCP. Practice installation, tools, resources, transports, and how LLMs interact with MCP servers.&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;

&lt;/div&gt;

&lt;h2 id=&quot;installing-python-mcp&quot;&gt;Installing Python MCP&lt;a class=&quot;headerlink&quot; href=&quot;#installing-python-mcp&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Python MCP is available on &lt;a href=&quot;https://pypi.org/&quot;&gt;PyPI&lt;/a&gt;, and you can install it with &lt;a href=&quot;https://realpython.com/what-is-pip/&quot;&gt;&lt;code&gt;pip&lt;/code&gt;&lt;/a&gt;. Open a terminal or command prompt, create a new &lt;a href=&quot;https://realpython.com/python-virtual-environments-a-primer/&quot;&gt;virtual environment&lt;/a&gt;, and then run the following command:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;console&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--yellow&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Shell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; role=&quot;button&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp gp-VirtualEnv&quot;&gt;(venv)&lt;/span&gt; &lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;python&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;-m&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;pip&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;install&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;mcp[cli]&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;This command will install the latest version of MCP from &lt;a href=&quot;/ref/glossary/pypi/&quot; class=&quot;ref-link&quot;&gt;PyPI&lt;/a&gt; onto your machine. To verify that the installation was successful, start a &lt;a href=&quot;https://realpython.com/python-repl/&quot;&gt;Python REPL&lt;/a&gt; and import MCP:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;pycon&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--blue&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Python&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; role=&quot;button&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nn&quot;&gt;mcp&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;If the import runs without error, then you’ve successfully installed MCP. You’ll also need &lt;a href=&quot;https://pypi.org/project/pytest-asyncio/&quot;&gt;&lt;code&gt;pytest-asyncio&lt;/code&gt;&lt;/a&gt; for this tutorial:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;console&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--yellow&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Shell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; role=&quot;button&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp gp-VirtualEnv&quot;&gt;(venv)&lt;/span&gt; &lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;python&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;-m&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;pip&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;install&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;pytest-asyncio
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;It’s a &lt;a href=&quot;https://realpython.com/pytest-python-testing/&quot;&gt;&lt;code&gt;pytest&lt;/code&gt;&lt;/a&gt; plugin that adds &lt;a href=&quot;https://realpython.com/async-io-python/&quot;&gt;&lt;code&gt;asyncio&lt;/code&gt;&lt;/a&gt; support, which you’ll use to test your MCP server. With that, you’ve installed all the Python dependencies you need, and you’re ready to dive into MCP! You’ll start with a brief introduction to MCP and its core concepts.&lt;/p&gt;
&lt;h2 id=&quot;what-is-mcp&quot;&gt;What Is MCP?&lt;a class=&quot;headerlink&quot; href=&quot;#what-is-mcp&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Before diving into the code for this tutorial, you’ll learn what MCP is and the problem it tries to solve. You’ll then explore MCP’s core primitives—prompts, resources, and tools.&lt;/p&gt;
&lt;h3 id=&quot;understanding-mcp&quot;&gt;Understanding MCP&lt;a class=&quot;headerlink&quot; href=&quot;#understanding-mcp&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;The &lt;a href=&quot;https://en.wikipedia.org/wiki/Model_Context_Protocol&quot;&gt;Model Context Protocol&lt;/a&gt; is a protocol for AI language models, often referred to as &lt;strong&gt;large language models (LLMs)&lt;/strong&gt;, that standardizes how they interact with the outside world. This interaction most often involves performing actions like sending emails, writing and executing code, making API requests, browsing the web, and much more.&lt;/p&gt;
&lt;p&gt;You might be wondering how LLMs are capable of this. How can an LLM that accepts text as input and returns text as output possibly perform actions? The key to this capability lies in &lt;strong&gt;function calling&lt;/strong&gt;—a process through which LLMs execute predefined functions in a programming language like Python. At a high level, here’s what an LLM function-calling workflow might look like:&lt;/p&gt;
&lt;figure class=&quot;js-lightbox&quot;&gt;&lt;a href=&quot;https://files.realpython.com/media/Screenshot_2025-08-18_at_1.44.26_PM.8e8c3dd50fef.png&quot; target=&quot;_blank&quot;&gt;&lt;img loading=&quot;lazy&quot; class=&quot;img-fluid mx-auto d-block &quot; src=&quot;https://files.realpython.com/media/Screenshot_2025-08-18_at_1.44.26_PM.8e8c3dd50fef.png&quot; width=&quot;2294&quot; height=&quot;1576&quot; srcset=&quot;/cdn-cgi/image/width=573,format=auto/https://files.realpython.com/media/Screenshot_2025-08-18_at_1.44.26_PM.8e8c3dd50fef.png 573w, /cdn-cgi/image/width=764,format=auto/https://files.realpython.com/media/Screenshot_2025-08-18_at_1.44.26_PM.8e8c3dd50fef.png 764w, /cdn-cgi/image/width=1147,format=auto/https://files.realpython.com/media/Screenshot_2025-08-18_at_1.44.26_PM.8e8c3dd50fef.png 1147w, /cdn-cgi/image/width=2294,format=auto/https://files.realpython.com/media/Screenshot_2025-08-18_at_1.44.26_PM.8e8c3dd50fef.png 2294w&quot; sizes=&quot;(min-width: 1200px) 690px, (min-width: 780px) calc(-5vw + 669px), (min-width: 580px) 510px, calc(100vw - 30px)&quot; alt=&quot;LLM Function Calling Workflow&quot; data-asset=&quot;6503&quot;&gt;&lt;/a&gt;&lt;figcaption class=&quot;figure-caption text-center&quot;&gt;LLM Function Calling Workflow&lt;/figcaption&gt;&lt;/figure&gt;

&lt;p&gt;The diagram above illustrates how an LLM and Python process could interact to perform an action through function calling. Here’s a breakdown of each step:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;User Prompt&lt;/strong&gt;: The user first sends a prompt to the Python process. For example, the user might ask a question that requires a database query to answer, such as “How many customers have ordered our product today?”&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Function Descriptions&lt;/strong&gt;: The Python process can expose several functions to the LLM, allowing it to decide which one to call. You do this by &lt;a href=&quot;/ref/glossary/type-hint/&quot; class=&quot;ref-link&quot;&gt;type hinting&lt;/a&gt; your functions’ input arguments and writing thorough &lt;a href=&quot;/ref/glossary/docstring/&quot; class=&quot;ref-link&quot;&gt;docstrings&lt;/a&gt; that describe what your functions do. An LLM framework like &lt;a href=&quot;https://www.langchain.com/langchain&quot;&gt;LangChain&lt;/a&gt; will convert your function definition into a text description and send it to an LLM along with the user prompt.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;User Prompt&lt;/strong&gt;: In combination with the function descriptions, the LLM also needs the user prompt to guide which function(s) it should call.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Function Call JSON&lt;/strong&gt;: Once the LLM receives the user prompt and a description of each function available in your Python process, it can decide which function to call by sending back a &lt;a href=&quot;https://realpython.com/python-json/&quot;&gt;JSON&lt;/a&gt; string. The JSON string must include the name of the function that the LLM wants to execute, as well as the inputs to pass to that function. If the JSON string is valid, then your Python process can convert it into a &lt;a href=&quot;https://realpython.com/python-dicts/&quot;&gt;dictionary&lt;/a&gt; and call the respective function.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Function Output&lt;/strong&gt;: If your Python process successfully executes the function call specified in the JSON string, it then sends the function’s output back to the LLM for further processing. This is useful because it allows the LLM to interpret and summarize the function’s output in a human-readable format. &lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Summarized Results&lt;/strong&gt;: The LLM returns summarized results back to the Python process. For example, if the user prompt is “How many customers have ordered our product today?”, the summarized result might be “10 customers have placed orders today.” Despite all of the work happening between the Python process and the LLM to query the database in this example, the user experience is seamless.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Summarized Results&lt;/strong&gt;: Lastly, the Python process gives the LLM’s summarized results to the user.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The power of MCP lies in its standardized architecture built around &lt;strong&gt;clients&lt;/strong&gt; and &lt;strong&gt;servers&lt;/strong&gt;. An MCP server is an &lt;a href=&quot;/ref/glossary/api/&quot; class=&quot;ref-link&quot;&gt;API&lt;/a&gt; that hosts the &lt;strong&gt;prompts&lt;/strong&gt;, &lt;strong&gt;resources&lt;/strong&gt;, and &lt;strong&gt;tools&lt;/strong&gt; you want to make available to an LLM. You’ll learn about prompts, resources, and tools shortly.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-mcp/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-mcp/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Strip Characters From a Python String</title>
      <id>https://realpython.com/courses/strip-characters-from-string/</id>
      <link href="https://realpython.com/courses/strip-characters-from-string/"/>
      <updated>2025-09-23T14:00:00+00:00</updated>
      <summary>Use Python&#x27;s .strip() to remove whitespace or chosen chars. Learn pitfalls, real-world cases, and compare with .lstrip() and .removesuffix().</summary>
      <content type="html">
        &lt;p&gt;By default, Python&amp;rsquo;s &lt;code&gt;.strip()&lt;/code&gt; method removes whitespace characters from both ends of a string. To remove different characters, you can pass a string as an argument that specifies a set of characters to remove. The &lt;code&gt;.strip()&lt;/code&gt; method is useful for tasks like cleaning user input, standardizing filenames, and preparing data for storage.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this video course, you&amp;rsquo;ll understand that:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;.strip()&lt;/code&gt; method &lt;strong&gt;removes leading and trailing whitespace&lt;/strong&gt; but doesn&amp;rsquo;t remove whitespace from the middle of a string.&lt;/li&gt;
&lt;li&gt;You can use &lt;code&gt;.strip()&lt;/code&gt; to remove &lt;strong&gt;specified characters&lt;/strong&gt; from both ends of the string by providing these characters as an &lt;strong&gt;argument&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;With the related methods &lt;strong&gt;&lt;code&gt;.lstrip()&lt;/code&gt; and &lt;code&gt;.rstrip()&lt;/code&gt;&lt;/strong&gt;, you can remove characters from &lt;strong&gt;one side&lt;/strong&gt; of the string only.&lt;/li&gt;
&lt;li&gt;All three methods, &lt;code&gt;.strip()&lt;/code&gt;, &lt;code&gt;.lstrip()&lt;/code&gt;, and &lt;code&gt;.rstrip()&lt;/code&gt;, &lt;strong&gt;remove character sets, not sequences&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;You can use &lt;strong&gt;&lt;code&gt;.removeprefix()&lt;/code&gt; and &lt;code&gt;.removesuffix()&lt;/code&gt;&lt;/strong&gt; to &lt;strong&gt;strip character sequences&lt;/strong&gt; from the start or end of a string.&lt;/li&gt;
&lt;/ul&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Quiz: Strip Characters From a Python String</title>
      <id>https://realpython.com/quizzes/strip-characters-from-string/</id>
      <link href="https://realpython.com/quizzes/strip-characters-from-string/"/>
      <updated>2025-09-23T12:00:00+00:00</updated>
      <summary>Test your Python skills on removing characters from strings using strip, lstrip, and rstrip. Practice default behavior, custom chars, and more.</summary>
      <content type="html">
        &lt;p&gt;Brush up on how Python&amp;rsquo;s strip, lstrip, and rstrip string methods work. You&amp;rsquo;ll practice how to remove whitespace, specific characters, and use the right tool for trimming string ends.&lt;/p&gt;
&lt;p&gt;Try these questions to check your understanding of default stripping, custom character sets, and the difference between stripping characters and removing sequences. Need a refresher? See &lt;a href=&quot;https://realpython.com/courses/strip-characters-from-string/&quot;&gt;Strip Characters From a Python String&lt;/a&gt;.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Get Started With FastAPI</title>
      <id>https://realpython.com/get-started-with-fastapi/</id>
      <link href="https://realpython.com/get-started-with-fastapi/"/>
      <updated>2025-09-22T14:00:00+00:00</updated>
      <summary>FastAPI is the first choice when creating APIs in Python. Explore FastAPI code examples and get the most frequent questions about FastAPI answered.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;FastAPI is a web framework for building APIs with Python. It leverages standard Python type hints to provide automatic validation, serialization, and interactive documentation. When you’re deciding between Python web frameworks, FastAPI stands out for its speed, developer experience, and built-in features that reduce boilerplate code for API development:&lt;/p&gt;
&lt;div class=&quot;table-responsive&quot;&gt;
&lt;table class=&quot;table table-hover&quot;&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Use Case&lt;/th&gt;
&lt;th class=&quot;text-center&quot;&gt;Pick FastAPI&lt;/th&gt;
&lt;th class=&quot;text-center&quot;&gt;Pick Flask or Django&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;You want to build an API-driven web app&lt;/td&gt;
&lt;td class=&quot;text-center&quot;&gt;✅&lt;/td&gt;
&lt;td class=&quot;text-center&quot;&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;You need a full-stack web framework&lt;/td&gt;
&lt;td class=&quot;text-center&quot;&gt;—&lt;/td&gt;
&lt;td class=&quot;text-center&quot;&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;You value automatic API documentation&lt;/td&gt;
&lt;td class=&quot;text-center&quot;&gt;✅&lt;/td&gt;
&lt;td class=&quot;text-center&quot;&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;Whether you’re building a minimal &lt;a href=&quot;https://realpython.com/api-integration-in-python/&quot;&gt;REST API&lt;/a&gt; or a complex backend service, understanding core features of &lt;a href=&quot;https://fastapi.tiangolo.com/&quot;&gt;FastAPI&lt;/a&gt; will help you make an informed decision about adopting it for your projects. To get the most from this tutorial, you’ll benefit from having basic knowledge of Python &lt;a href=&quot;https://realpython.com/defining-your-own-python-function/&quot;&gt;functions&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/python-requests/&quot;&gt;HTTP concepts&lt;/a&gt;, and &lt;a href=&quot;https://realpython.com/python-json/&quot;&gt;JSON&lt;/a&gt; handling.&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown&gt;Get Your Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/get-started-with-fastapi-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-get-started-with-fastapi-code&quot; markdown&gt;Click here to download the free sample code&lt;/a&gt; that shows you how to get started with FastAPI.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;container border rounded text-wrap-pretty my-3&quot;&gt;

  &lt;p class=&quot;my-3&quot;&gt;&lt;mark class=&quot;marker-highlight&quot;&gt;&lt;strong&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt; Take the Quiz:&lt;/strong&gt;&lt;/mark&gt; Test your knowledge with our interactive “Get Started With FastAPI” quiz. You’ll receive a score upon completion to help you track your learning progress:&lt;/p&gt;

  &lt;hr&gt;

  &lt;div class=&quot;row my-3&quot;&gt;
    &lt;div class=&quot;col-xs-12 col-sm-4 col-md-3 align-self-center&quot;&gt;

      &lt;a href=&quot;/quizzes/get-started-with-fastapi/&quot; tabindex=&quot;-1&quot;&gt;
        &lt;div class=&quot;embed-responsive embed-responsive-16by9&quot;&gt;

            &lt;img class=&quot;card-img-top m-0 p-0 embed-responsive-item rounded&quot; style=&quot;object-fit: contain; background: #b9abe6;&quot; alt=&quot;Get Started With FastAPI&quot; src=&quot;https://files.realpython.com/media/Getting-Started-With-FastAPI_Watermarked.c54d01d33243.jpg&quot; width=&quot;1920&quot; height=&quot;1080&quot; srcset=&quot;/cdn-cgi/image/width=480,format=auto/https://files.realpython.com/media/Getting-Started-With-FastAPI_Watermarked.c54d01d33243.jpg 480w, /cdn-cgi/image/width=640,format=auto/https://files.realpython.com/media/Getting-Started-With-FastAPI_Watermarked.c54d01d33243.jpg 640w, /cdn-cgi/image/width=960,format=auto/https://files.realpython.com/media/Getting-Started-With-FastAPI_Watermarked.c54d01d33243.jpg 960w, /cdn-cgi/image/width=1920,format=auto/https://files.realpython.com/media/Getting-Started-With-FastAPI_Watermarked.c54d01d33243.jpg 1920w&quot; sizes=&quot;(min-width: 1200px) 142px, (min-width: 1000px) 122px, (min-width: 780px) 112px, (min-width: 580px) 139px, calc(100vw - 62px)&quot;&gt;


          &lt;div class=&quot;card-img-overlay d-flex align-items-center&quot;&gt;
            &lt;div class=&quot;mx-auto&quot;&gt;
              &lt;span class=&quot;text-light&quot; style=&quot;opacity: 0.90;&quot;&gt;&lt;span class=&quot;icon baseline scale2x&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/a&gt;

    &lt;/div&gt;
    &lt;div class=&quot;col&quot;&gt;
      &lt;div class=&quot;mt-3 d-md-none&quot;&gt;&lt;/div&gt; 
      &lt;p class=&quot;small text-muted mb-0&quot;&gt;&lt;strong&gt;Interactive Quiz&lt;/strong&gt;&lt;/p&gt;
      &lt;a href=&quot;/quizzes/get-started-with-fastapi/&quot; class=&quot;stretched-link&quot;&gt;&lt;span class=&quot;my-0 h4&quot;&gt;Get Started With FastAPI&lt;/span&gt;&lt;/a&gt; 
      &lt;p class=&quot;text-muted mb-0 small&quot;&gt;This hands-on quiz will test your knowledge of FastAPI basics, from installation and endpoints to automatic JSON responses and Swagger UI.&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;

&lt;/div&gt;

&lt;h2 id=&quot;install-fastapi-the-right-way&quot;&gt;Install FastAPI the Right Way&lt;a class=&quot;headerlink&quot; href=&quot;#install-fastapi-the-right-way&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Installing FastAPI correctly sets the foundation for a smooth development experience. Unlike many Python &lt;a href=&quot;/ref/glossary/package/&quot; class=&quot;ref-link&quot;&gt;packages&lt;/a&gt; that you can install with just &lt;code&gt;pip install &amp;lt;package&amp;gt;&lt;/code&gt;, FastAPI’s installation approach has evolved to provide better out-of-the-box functionality. Understanding these installation options will save you time and prevent common configuration issues.&lt;/p&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Before exploring any new package, it’s a good idea to create and activate a &lt;a href=&quot;https://realpython.com/python-virtual-environments-a-primer/&quot;&gt;virtual environment&lt;/a&gt;. That way, you’re installing any project dependencies in your project’s &lt;a href=&quot;/ref/glossary/virtual-environment/&quot; class=&quot;ref-link&quot;&gt;virtual environment&lt;/a&gt; instead of system-wide.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;The recommended way to install FastAPI is with the &lt;a href=&quot;https://github.com/fastapi/fastapi/blob/16d75d90eb96976a57b94cc24e4018859cd54c4d/pyproject.toml#L60&quot;&gt;&lt;code&gt;[standard]&lt;/code&gt;&lt;/a&gt; extra dependencies. This ensures you get all the tools you need for developing an API without having to hunt down additional packages later:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;console&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--yellow&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Shell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; role=&quot;button&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;python&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;-m&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;pip&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;install&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;fastapi[standard]&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;The quotes around &lt;code&gt;&quot;fastapi[standard]&quot;&lt;/code&gt; ensure the command works correctly across different &lt;a href=&quot;https://realpython.com/terminal-commands/&quot;&gt;terminals&lt;/a&gt; and operating systems. With the command above, you install several useful packages, including the &lt;a href=&quot;https://fastapi.tiangolo.com/fastapi-cli/&quot;&gt;FastAPI CLI&lt;/a&gt; and &lt;a href=&quot;https://www.uvicorn.org/&quot;&gt;uvicorn&lt;/a&gt;, an &lt;a href=&quot;https://en.wikipedia.org/wiki/Asynchronous_Server_Gateway_Interface&quot;&gt;ASGI&lt;/a&gt; server for running your application.&lt;/p&gt;
&lt;p&gt;If you prefer a minimal installation without these extras, then you can install just the core framework. However, you’ll likely need to install uvicorn separately to run your application:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;console&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--yellow&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Shell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; role=&quot;button&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;python&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;-m&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;pip&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;install&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;fastapi&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;uvicorn
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;For this tutorial, you’ll use the &lt;code&gt;[standard]&lt;/code&gt; installation to take advantage of all FastAPI’s built-in capabilities. You can verify your installation by checking the FastAPI version in the &lt;a href=&quot;https://realpython.com/python-repl/&quot;&gt;Python REPL&lt;/a&gt;:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;pycon&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--blue&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Python&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; role=&quot;button&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nn&quot;&gt;fastapi&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;fastapi&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;__version__&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;&#x27;0.116.1&#x27;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;With FastAPI properly installed, you’re ready to create your first web API application. The next step is to build a minimal example that demonstrates FastAPI’s core capabilities.&lt;/p&gt;
&lt;h2 id=&quot;create-the-most-minimal-fastapi-app&quot;&gt;Create the Most Minimal FastAPI App&lt;a class=&quot;headerlink&quot; href=&quot;#create-the-most-minimal-fastapi-app&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Creating a basic FastAPI application requires just a few lines of code. You’ll start with a basic &lt;a href=&quot;https://en.wikipedia.org/wiki/%22Hello,_World!%22_program&quot;&gt;“Hello, World!”&lt;/a&gt; example that demonstrates the framework’s approach to building APIs.&lt;/p&gt;
&lt;p&gt;You can name your FastAPI main file however you like. Common names are &lt;code&gt;app.py&lt;/code&gt;, &lt;code&gt;api.py&lt;/code&gt;, or &lt;code&gt;main.py&lt;/code&gt;. To follow along, create a file called &lt;code&gt;main.py&lt;/code&gt;:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;python&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--blue&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Python&lt;/span&gt;
    &lt;span class=&quot;mr-2&quot; aria-label=&quot;Filename&quot;&gt;&lt;code style=&quot;color: inherit; background: inherit;&quot;&gt;main.py&lt;/code&gt;&lt;/span&gt;
    &lt;div class=&quot;noselect&quot;&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nn&quot;&gt;fastapi&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;FastAPI&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;app&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;FastAPI&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;

&lt;span class=&quot;nd&quot;&gt;@app&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;/&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;home&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;():&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;message&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Hello, FastAPI!&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/get-started-with-fastapi/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/get-started-with-fastapi/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Quiz: Get Started With FastAPI</title>
      <id>https://realpython.com/quizzes/get-started-with-fastapi/</id>
      <link href="https://realpython.com/quizzes/get-started-with-fastapi/"/>
      <updated>2025-09-22T12:00:00+00:00</updated>
      <summary>This hands-on quiz will test your knowledge of FastAPI basics, from installation and endpoints to automatic JSON responses and Swagger UI.</summary>
      <content type="html">
        &lt;p&gt;Brush up on core FastAPI concepts with this short quiz. You&amp;rsquo;ll revisit how to install FastAPI with extras, define API endpoints, and understand path and query parameters. See how FastAPI handles JSON responses and where to find the built-in API docs.&lt;/p&gt;
&lt;p&gt;Want to review first? Check out &lt;a href=&quot;https://realpython.com/get-started-with-fastapi/&quot;&gt;Get Started With FastAPI&lt;/a&gt; for a practical walkthrough of these features.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #266: Dangers of Automatically Converting a REST API to MCP</title>
      <id>https://realpython.com/podcasts/rpp/266/</id>
      <link href="https://realpython.com/podcasts/rpp/266/"/>
      <updated>2025-09-19T12:00:00+00:00</updated>
      <summary>When converting an existing REST API to the Model Context Protocol, what should you consider? What anti-patterns should you avoid to keep an AI agent’s context clean? This week on the show, Kyle Stratis returns to discuss his upcoming book, &quot;AI Agents with MCP&quot;.</summary>
      <content type="html">
        &lt;p&gt;When converting an existing REST API to the Model Context Protocol, what should you consider? What anti-patterns should you avoid to keep an AI agent’s context clean? This week on the show, Kyle Stratis returns to discuss his upcoming book, &quot;AI Agents with MCP&quot;.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Quiz: What Can You Do With Python?</title>
      <id>https://realpython.com/quizzes/what-can-you-do-with-python/</id>
      <link href="https://realpython.com/quizzes/what-can-you-do-with-python/"/>
      <updated>2025-09-18T12:00:00+00:00</updated>
      <summary>Review where Python shines: web, APIs, CLIs, GUIs, data science, ORMs, automation, and robots. Practice key terms, tools, and workflows.</summary>
      <content type="html">
        &lt;p&gt;Sharpen your sense of where Python fits. You&amp;rsquo;ll revisit web frameworks, CLIs and TUIs, GUIs, data work, and robotics.&lt;/p&gt;
&lt;p&gt;Use hints when stuck, then read the explanations. For a quick big-picture refresher, watch &lt;a href=&quot;https://realpython.com/courses/what-can-you-do-with-python/&quot;&gt;What Can You Do With Python?&lt;/a&gt;.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Quiz: Ways to Start Interacting With Python</title>
      <id>https://realpython.com/quizzes/interactive-python/</id>
      <link href="https://realpython.com/quizzes/interactive-python/"/>
      <updated>2025-09-18T12:00:00+00:00</updated>
      <summary>Test your knowledge of running Python interactively using REPL, scripts, and IDEs, and clarify key concepts.</summary>
      <content type="html">
        &lt;p&gt;Want to revisit different ways to run Python code interactively? In this quiz, you&amp;rsquo;ll review concepts such as using the REPL, executing scripts, and working within IDEs.&lt;/p&gt;
&lt;p&gt;Before starting, make sure you&amp;rsquo;ve gone through the &lt;a href=&quot;https://realpython.com/courses/interactive-python/&quot;&gt;Ways to Start Interacting With Python&lt;/a&gt; course to get the most from these questions.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Python 3.14 Preview: REPL Autocompletion and Highlighting</title>
      <id>https://realpython.com/python-repl-autocompletion-highlighting/</id>
      <link href="https://realpython.com/python-repl-autocompletion-highlighting/"/>
      <updated>2025-09-17T14:00:00+00:00</updated>
      <summary>Explore Python 3.14 REPL updates: import autocompletion, syntax coloring, and theme customization to help you code faster and read with ease.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Python 3.14 introduces improvements to its interactive shell (REPL), bringing a more modern, colorful, and user-friendly environment. The new features make the Python 3.14 REPL a powerful tool for experimentation. Whether you’re testing a quick idea, exploring a new library, or debugging a tricky snippet, the REPL gives you instant feedback—no files, no setup, just type and run.&lt;/p&gt;
&lt;p&gt;The default CPython REPL intentionally kept things minimal. It was fast, reliable, and available everywhere, but it lacked the richer, more ergonomic features found in tools like &lt;a href=&quot;https://realpython.com/ipython-interactive-python-shell/&quot;&gt;IPython&lt;/a&gt; or &lt;a href=&quot;https://realpython.com/ptpython-shell/&quot;&gt;ptpython&lt;/a&gt;. That began to change in &lt;strong&gt;Python 3.13&lt;/strong&gt;, when CPython adopted a modern PyREPL-based shell by default, adding multiline editing, better history navigation, and smarter &lt;span class=&quot;keys&quot;&gt;&lt;kbd class=&quot;key-tab&quot;&gt;Tab&lt;/kbd&gt;&lt;/span&gt; completion.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this tutorial, you’ll understand that:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;In Python 3.14’s REPL, &lt;strong&gt;autocompletion&lt;/strong&gt; is on by default. You just need to press &lt;span class=&quot;keys&quot;&gt;&lt;kbd class=&quot;key-tab&quot;&gt;Tab&lt;/kbd&gt;&lt;/span&gt; in the context of an &lt;code&gt;import&lt;/code&gt; statement to see possible completion suggestions.&lt;/li&gt;
&lt;li&gt;The REPL &lt;strong&gt;highlights&lt;/strong&gt; Python syntax in real time if your terminal supports ANSI colors.&lt;/li&gt;
&lt;li&gt;Python 3.14 allows you to &lt;strong&gt;customize the color theme&lt;/strong&gt; with the &lt;code&gt;_colorize.set_theme()&lt;/code&gt; experimental API and the &lt;code&gt;PYTHONSTARTUP&lt;/code&gt; script.&lt;/li&gt;
&lt;li&gt;You can disable the &lt;strong&gt;syntax highlighting&lt;/strong&gt; by setting &lt;code&gt;NO_COLOR=1&lt;/code&gt; or &lt;code&gt;PYTHON_COLORS=0&lt;/code&gt; in your environment.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Autocompleting module names during &lt;code&gt;import&lt;/code&gt; statements makes interactive coding smoother and faster, especially for learning or exploratory tasks. In addition, the colored syntax in the REPL improves readability, making it easier to spot typos and syntax issues.&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown&gt;Get Your Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-repl-autocompletion-highlighting/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-repl-autocompletion-highlighting&quot; markdown&gt;Click here to download the free sample code&lt;/a&gt; that you’ll use to learn about REPL autocompletion and highlighting in Python 3.14.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;container border rounded text-wrap-pretty my-3&quot;&gt;

  &lt;p class=&quot;my-3&quot;&gt;&lt;mark class=&quot;marker-highlight&quot;&gt;&lt;strong&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt; Take the Quiz:&lt;/strong&gt;&lt;/mark&gt; Test your knowledge with our interactive “Python 3.14 Preview: REPL Autocompletion and Highlighting” quiz. You’ll receive a score upon completion to help you track your learning progress:&lt;/p&gt;

  &lt;hr&gt;

  &lt;div class=&quot;row my-3&quot;&gt;
    &lt;div class=&quot;col-xs-12 col-sm-4 col-md-3 align-self-center&quot;&gt;

      &lt;a href=&quot;/quizzes/python-repl-autocompletion-highlighting/&quot; tabindex=&quot;-1&quot;&gt;
        &lt;div class=&quot;embed-responsive embed-responsive-16by9&quot;&gt;

            &lt;img class=&quot;card-img-top m-0 p-0 embed-responsive-item rounded&quot; style=&quot;object-fit: contain; background: #ffc973;&quot; alt=&quot;Python 3.14 Preview: REPL Autocompletion and Highlighting&quot; src=&quot;https://files.realpython.com/media/Python-3.14-Preview-REPL-Autocompletion-and-Highlighting_Watermarked.72f0b769acf1.jpg&quot; width=&quot;1920&quot; height=&quot;1080&quot; srcset=&quot;/cdn-cgi/image/width=480,format=auto/https://files.realpython.com/media/Python-3.14-Preview-REPL-Autocompletion-and-Highlighting_Watermarked.72f0b769acf1.jpg 480w, /cdn-cgi/image/width=640,format=auto/https://files.realpython.com/media/Python-3.14-Preview-REPL-Autocompletion-and-Highlighting_Watermarked.72f0b769acf1.jpg 640w, /cdn-cgi/image/width=960,format=auto/https://files.realpython.com/media/Python-3.14-Preview-REPL-Autocompletion-and-Highlighting_Watermarked.72f0b769acf1.jpg 960w, /cdn-cgi/image/width=1920,format=auto/https://files.realpython.com/media/Python-3.14-Preview-REPL-Autocompletion-and-Highlighting_Watermarked.72f0b769acf1.jpg 1920w&quot; sizes=&quot;(min-width: 1200px) 142px, (min-width: 1000px) 122px, (min-width: 780px) 112px, (min-width: 580px) 139px, calc(100vw - 62px)&quot;&gt;


          &lt;div class=&quot;card-img-overlay d-flex align-items-center&quot;&gt;
            &lt;div class=&quot;mx-auto&quot;&gt;
              &lt;span class=&quot;text-light&quot; style=&quot;opacity: 0.90;&quot;&gt;&lt;span class=&quot;icon baseline scale2x&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/a&gt;

    &lt;/div&gt;
    &lt;div class=&quot;col&quot;&gt;
      &lt;div class=&quot;mt-3 d-md-none&quot;&gt;&lt;/div&gt; 
      &lt;p class=&quot;small text-muted mb-0&quot;&gt;&lt;strong&gt;Interactive Quiz&lt;/strong&gt;&lt;/p&gt;
      &lt;a href=&quot;/quizzes/python-repl-autocompletion-highlighting/&quot; class=&quot;stretched-link&quot;&gt;&lt;span class=&quot;my-0 h4&quot;&gt;Python 3.14 Preview: REPL Autocompletion and Highlighting&lt;/span&gt;&lt;/a&gt; 
      &lt;p class=&quot;text-muted mb-0 small&quot;&gt;Take this quiz to explore Python 3.14&#x27;s REPL upgrades! Test your knowledge of new autocompletion tools and built-in syntax highlighting.&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;

&lt;/div&gt;

&lt;h2 id=&quot;the-interactive-repl-before-python-314&quot;&gt;The Interactive REPL Before Python 3.14&lt;a class=&quot;headerlink&quot; href=&quot;#the-interactive-repl-before-python-314&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;When you first install Python, one of the most immediate ways to try it out is through the interactive &lt;a href=&quot;/ref/glossary/repl/&quot; class=&quot;ref-link&quot;&gt;&lt;strong&gt;REPL&lt;/strong&gt; (Read–Eval–Print Loop)&lt;/a&gt; in your command line or terminal. The &lt;a href=&quot;https://realpython.com/python-repl/&quot;&gt;REPL&lt;/a&gt; is a shell that lets you type Python code, run it instantly, and see the result. It’s a quick-start environment perfect for experimentation, learning, and &lt;a href=&quot;/ref/glossary/debugging/&quot; class=&quot;ref-link&quot;&gt;debugging&lt;/a&gt; without the overhead of creating and running separate scripts.&lt;/p&gt;
&lt;p&gt;For years, the default &lt;a href=&quot;https://realpython.com/cpython-source-code-guide/&quot;&gt;CPython&lt;/a&gt; REPL kept things lightweight and fairly minimal, with very few features. In contrast, tools like &lt;a href=&quot;https://realpython.com/ipython-interactive-python-shell/&quot;&gt;IPython&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/bpython-alternative-python-repl/&quot;&gt;bpython&lt;/a&gt;, and &lt;a href=&quot;https://realpython.com/ptpython-shell/&quot;&gt;ptpython&lt;/a&gt; have offered richer interactive experiences.&lt;/p&gt;
&lt;p&gt;This landscape has been changing lately. Starting in &lt;a href=&quot;https://realpython.com/python313-new-features/&quot;&gt;Python 3.13&lt;/a&gt;, the default REPL is based on &lt;a href=&quot;https://realpython.com/pypy-faster-python/&quot;&gt;PyPy’s&lt;/a&gt; &lt;a href=&quot;https://github.com/pypy/pyrepl&quot;&gt;&lt;code&gt;pyrepl&lt;/code&gt;&lt;/a&gt;, which is written in Python and designed for extensibility and safety. It’s also a more capable interactive shell with a modern set of features:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Color by default:&lt;/strong&gt; Take advantage of colorized prompts and &lt;a href=&quot;https://realpython.com/python-traceback/&quot;&gt;tracebacks&lt;/a&gt;. You can also control this behavior with the &lt;code&gt;PYTHON_COLORS&lt;/code&gt; or &lt;code&gt;NO_COLOR&lt;/code&gt; environment variables.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Quick REPL commands:&lt;/strong&gt; Use &lt;code&gt;exit&lt;/code&gt;, &lt;code&gt;quit&lt;/code&gt;, &lt;code&gt;help&lt;/code&gt;, and &lt;code&gt;clear&lt;/code&gt; as commands rather than function calls with parentheses.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Built‑in help browser:&lt;/strong&gt; Press &lt;span class=&quot;keys&quot;&gt;&lt;kbd class=&quot;key-f1&quot;&gt;F1&lt;/kbd&gt;&lt;/span&gt; to open a help viewer in your pager so you can browse docs for Python, modules, and objects.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Persistent history browser:&lt;/strong&gt; Press &lt;span class=&quot;keys&quot;&gt;&lt;kbd class=&quot;key-f2&quot;&gt;F2&lt;/kbd&gt;&lt;/span&gt; to open your command history in a pager and keep it across sessions so you can copy and reuse code.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Multiline editing:&lt;/strong&gt; Edit and rerun entire code blocks—&lt;a href=&quot;/ref/glossary/function/&quot; class=&quot;ref-link&quot;&gt;functions&lt;/a&gt;, &lt;a href=&quot;/ref/glossary/class/&quot; class=&quot;ref-link&quot;&gt;classes&lt;/a&gt;, &lt;a href=&quot;/ref/glossary/loop/&quot; class=&quot;ref-link&quot;&gt;loops&lt;/a&gt;—as a single unit. The block structure is preserved in your history.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Robust pasting and paste mode:&lt;/strong&gt; Paste whole scripts or larger code blocks reliably by default. Optionally, you can access paste mode with &lt;span class=&quot;keys&quot;&gt;&lt;kbd class=&quot;key-f3&quot;&gt;F3&lt;/kbd&gt;&lt;/span&gt;, although direct pasting usually works without issue.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Smarter &lt;span class=&quot;keys&quot;&gt;&lt;kbd class=&quot;key-tab&quot;&gt;Tab&lt;/kbd&gt;&lt;/span&gt; completion:&lt;/strong&gt; Completions update as you type and hide irrelevant suggestions to reduce noise.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In Python 3.14, the REPL has taken another leap forward by including the following improvements:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Extended autocompletion&lt;/strong&gt; that now covers module and submodule names in &lt;a href=&quot;https://realpython.com/python-import/&quot;&gt;&lt;code&gt;import&lt;/code&gt;&lt;/a&gt; statements&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Live syntax highlighting&lt;/strong&gt; that makes your interactive code as readable as in your favorite &lt;a href=&quot;https://realpython.com/python-ides-code-editors-guide/&quot;&gt;code editor&lt;/a&gt; or &lt;a href=&quot;/ref/glossary/ide/&quot; class=&quot;ref-link&quot;&gt;IDE&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You don’t need to perform any extra installation or configuration to start using these new features as long as your terminal supports &lt;a href=&quot;https://en.wikipedia.org/wiki/ANSI_escape_code&quot;&gt;ANSI&lt;/a&gt; color output.&lt;/p&gt;
&lt;p&gt;In the sections ahead, you’ll explore what these improvements look like in practice, learn how to use them in your workflow, and pick up some troubleshooting tips for when things don’t behave quite as expected.&lt;/p&gt;
&lt;h2 id=&quot;autocompletion-improvements&quot;&gt;Autocompletion Improvements&lt;a class=&quot;headerlink&quot; href=&quot;#autocompletion-improvements&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Python 3.14 extends the autocompletion logic to recognize &lt;a href=&quot;/ref/keywords/import/&quot; class=&quot;ref-link&quot;&gt;&lt;code&gt;import&lt;/code&gt;&lt;/a&gt; contexts and suggest &lt;a href=&quot;/ref/glossary/module/&quot; class=&quot;ref-link&quot;&gt;module&lt;/a&gt; or &lt;a href=&quot;/ref/glossary/package/&quot; class=&quot;ref-link&quot;&gt;package&lt;/a&gt; names accordingly. Now, when you type an &lt;code&gt;import&lt;/code&gt; or &lt;code&gt;from ... import&lt;/code&gt; statement and press &lt;span class=&quot;keys&quot;&gt;&lt;kbd class=&quot;key-tab&quot;&gt;Tab&lt;/kbd&gt;&lt;/span&gt;, the REPL will search the &lt;a href=&quot;/ref/glossary/import-path/&quot; class=&quot;ref-link&quot;&gt;import path&lt;/a&gt; for available module names matching the partial text.&lt;/p&gt;
&lt;p&gt;For example, if you type &lt;code&gt;import&lt;/code&gt; and then press &lt;span class=&quot;keys&quot;&gt;&lt;kbd class=&quot;key-tab&quot;&gt;Tab&lt;/kbd&gt;&lt;/span&gt; twice, you’ll get the complete list of currently available modules and packages. If you start typing a module’s name like &lt;code&gt;pat&lt;/code&gt; and press &lt;span class=&quot;keys&quot;&gt;&lt;kbd class=&quot;key-tab&quot;&gt;Tab&lt;/kbd&gt;&lt;/span&gt;, the REPL will automatically complete the &lt;a href=&quot;/ref/stdlib/pathlib/&quot; class=&quot;ref-link&quot;&gt;&lt;code&gt;pathlib&lt;/code&gt;&lt;/a&gt; name because it matches uniquely with the partial text.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-repl-autocompletion-highlighting/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-repl-autocompletion-highlighting/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Quiz: Python 3.14 Preview: REPL Autocompletion and Highlighting</title>
      <id>https://realpython.com/quizzes/python-repl-autocompletion-highlighting/</id>
      <link href="https://realpython.com/quizzes/python-repl-autocompletion-highlighting/"/>
      <updated>2025-09-17T12:00:00+00:00</updated>
      <summary>Take this quiz to explore Python 3.14&#x27;s REPL upgrades! Test your knowledge of new autocompletion tools and built-in syntax highlighting.</summary>
      <content type="html">
        &lt;p&gt;In this quiz, you&amp;rsquo;ll test your understanding of &lt;a href=&quot;https://realpython.com/python-repl-autocompletion-highlighting/&quot;&gt;Python 3.14 Preview: REPL Autocompletion and Highlighting&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;With these skills, you&amp;rsquo;ll be able to take advantage of smarter autocompletion in &lt;code&gt;import&lt;/code&gt; statements, real-time syntax highlighting, and even customize or disable the colors to fit your workflow.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Python Project Management With uv</title>
      <id>https://realpython.com/courses/python-project-management-with-uv/</id>
      <link href="https://realpython.com/courses/python-project-management-with-uv/"/>
      <updated>2025-09-16T14:00:00+00:00</updated>
      <summary>Create and manage Python projects with uv, a blazing-fast package and project manager built in Rust. Learn setup, workflow, and best practices.</summary>
      <content type="html">
        &lt;p&gt;The &lt;code&gt;uv&lt;/code&gt; tool is a high-speed package and project manager for Python. It&amp;rsquo;s written in Rust and designed to streamline your workflow. It offers fast dependency installation and integrates various functionalities into a single tool.&lt;/p&gt;
&lt;p&gt;With &lt;code&gt;uv&lt;/code&gt;, you can install and manage multiple Python versions, create virtual environments, efficiently handle project dependencies, reproduce working environments, and even build and publish a project. These capabilities make &lt;code&gt;uv&lt;/code&gt; an all-in-one tool for Python project management.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this video course, you&amp;rsquo;ll understand that:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;uv&lt;/code&gt; is a Python package and project manager&lt;/strong&gt; that integrates multiple functionalities into one tool, offering a comprehensive solution for managing Python projects.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;uv&lt;/code&gt; is used for fast dependency installation&lt;/strong&gt;, virtual environment management, Python version management, and project initialization, enhancing productivity and efficiency.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;uv&lt;/code&gt; can build and publish Python packages&lt;/strong&gt; to package repositories like PyPI, supporting a streamlined process from development to distribution.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;uv&lt;/code&gt; automatically handles virtual environments&lt;/strong&gt;, creating and managing them as needed to ensure clean and isolated project dependencies.&lt;/li&gt;
&lt;/ul&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>What Does -&gt; Mean in Python Function Definitions?</title>
      <id>https://realpython.com/what-does-arrow-mean-in-python/</id>
      <link href="https://realpython.com/what-does-arrow-mean-in-python/"/>
      <updated>2025-09-15T14:00:00+00:00</updated>
      <summary>Wondering what the arrow notation means in Python? Discover how -&gt; is used in type hints, functions, and more, with clear explanations and examples.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;In Python, the arrow symbol (&lt;code&gt;-&amp;gt;&lt;/code&gt;) appears in function definitions as a notation to indicate the expected return type. This notation is optional, but when you include it, you clarify what data type a function should return:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;pycon&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--blue&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Python&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; role=&quot;button&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;get_number_of_titles&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;titles&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;... &lt;/span&gt;    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;len&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;titles&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;You may have observed that not all Python code includes this particular syntax. What does the arrow notation mean? In this tutorial, you’ll learn what it is, how to use it, and why its usage sometimes seems so inconsistent.&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown&gt;Get Your Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/what-does-arrow-mean-in-python-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-what-does-arrow-mean-in-python-code&quot; markdown&gt;Click here to download the free sample code&lt;/a&gt; that you’ll use to learn what -&amp;gt; means in Python function definitions.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;container border rounded text-wrap-pretty my-3&quot;&gt;

  &lt;p class=&quot;my-3&quot;&gt;&lt;mark class=&quot;marker-highlight&quot;&gt;&lt;strong&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt; Take the Quiz:&lt;/strong&gt;&lt;/mark&gt; Test your knowledge with our interactive “What Does -&amp;gt; Mean in Python Function Definitions?” quiz. You’ll receive a score upon completion to help you track your learning progress:&lt;/p&gt;

  &lt;hr&gt;

  &lt;div class=&quot;row my-3&quot;&gt;
    &lt;div class=&quot;col-xs-12 col-sm-4 col-md-3 align-self-center&quot;&gt;

      &lt;a href=&quot;/quizzes/what-does-arrow-mean-in-python/&quot; tabindex=&quot;-1&quot;&gt;
        &lt;div class=&quot;embed-responsive embed-responsive-16by9&quot;&gt;

            &lt;img class=&quot;card-img-top m-0 p-0 embed-responsive-item rounded&quot; style=&quot;object-fit: contain; background: #ffc973;&quot; alt=&quot;What Does -&amp;gt; Mean in Python Function Definitions?&quot; src=&quot;https://files.realpython.com/media/What-Does---Mean-in-Python-Function-Definitions_Watermarked.09532d39d0e8.jpg&quot; width=&quot;1920&quot; height=&quot;1080&quot; srcset=&quot;/cdn-cgi/image/width=480,format=auto/https://files.realpython.com/media/What-Does---Mean-in-Python-Function-Definitions_Watermarked.09532d39d0e8.jpg 480w, /cdn-cgi/image/width=640,format=auto/https://files.realpython.com/media/What-Does---Mean-in-Python-Function-Definitions_Watermarked.09532d39d0e8.jpg 640w, /cdn-cgi/image/width=960,format=auto/https://files.realpython.com/media/What-Does---Mean-in-Python-Function-Definitions_Watermarked.09532d39d0e8.jpg 960w, /cdn-cgi/image/width=1920,format=auto/https://files.realpython.com/media/What-Does---Mean-in-Python-Function-Definitions_Watermarked.09532d39d0e8.jpg 1920w&quot; sizes=&quot;(min-width: 1200px) 142px, (min-width: 1000px) 122px, (min-width: 780px) 112px, (min-width: 580px) 139px, calc(100vw - 62px)&quot;&gt;


          &lt;div class=&quot;card-img-overlay d-flex align-items-center&quot;&gt;
            &lt;div class=&quot;mx-auto&quot;&gt;
              &lt;span class=&quot;text-light&quot; style=&quot;opacity: 0.90;&quot;&gt;&lt;span class=&quot;icon baseline scale2x&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/a&gt;

    &lt;/div&gt;
    &lt;div class=&quot;col&quot;&gt;
      &lt;div class=&quot;mt-3 d-md-none&quot;&gt;&lt;/div&gt; 
      &lt;p class=&quot;small text-muted mb-0&quot;&gt;&lt;strong&gt;Interactive Quiz&lt;/strong&gt;&lt;/p&gt;
      &lt;a href=&quot;/quizzes/what-does-arrow-mean-in-python/&quot; class=&quot;stretched-link&quot;&gt;&lt;span class=&quot;my-0 h4&quot;&gt;What Does -&amp;gt; Mean in Python Function Definitions?&lt;/span&gt;&lt;/a&gt; 
      &lt;p class=&quot;text-muted mb-0 small&quot;&gt;Test your understanding of Python return type hints and learn how to use the -&amp;gt; arrow, annotate containers, and check code with static tools.&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;

&lt;/div&gt;

&lt;h2 id=&quot;in-short-the-notation-indicates-a-functions-return-type-in-python&quot;&gt;In Short: The &lt;code&gt;-&amp;gt;&lt;/code&gt; Notation Indicates a Function’s Return Type in Python&lt;a class=&quot;headerlink&quot; href=&quot;#in-short-the-notation-indicates-a-functions-return-type-in-python&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;In Python, every value stored in a &lt;a href=&quot;/ref/glossary/variable/&quot; class=&quot;ref-link&quot;&gt;variable&lt;/a&gt; has a &lt;a href=&quot;/ref/glossary/type/&quot; class=&quot;ref-link&quot;&gt;type&lt;/a&gt;. Because Python is dynamically typed, variables themselves don’t have fixed types—they can hold values of any type at different times. This means the same variable might store an &lt;a href=&quot;/ref/builtin-types/int/&quot; class=&quot;ref-link&quot;&gt;integer&lt;/a&gt; at one moment and a &lt;a href=&quot;/ref/builtin-types/str/&quot; class=&quot;ref-link&quot;&gt;string&lt;/a&gt; the next. In contrast, statically typed languages like &lt;a href=&quot;https://realpython.com/python-vs-cpp/&quot;&gt;C++&lt;/a&gt; or &lt;a href=&quot;https://realpython.com/java-vs-python/&quot;&gt;Java&lt;/a&gt; require explicit type declarations, and variables are bound to a specific type throughout their lifetime.&lt;/p&gt;
&lt;p&gt;You can see an example of a dynamically typed Python variable in the following code example:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;pycon&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--blue&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Python&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; role=&quot;button&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;my_number&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;32&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;my_number&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;32&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;You start by declaring a variable called &lt;code&gt;my_number&lt;/code&gt;, and setting it to the integer value &lt;code&gt;32&lt;/code&gt;. You then change the variable’s value to the string value &lt;code&gt;&quot;32&quot;&lt;/code&gt;. When you run this code in a Python environment, you don’t encounter any problems with the value change.&lt;/p&gt;
&lt;p&gt;Dynamic typing also means you might not always know what data type a Python function will return, if it returns anything at all. Still, it’s often useful to know the return type. To address this, Python 3.5 introduced optional type hints, which allow developers to specify return types. To add a &lt;a href=&quot;/ref/glossary/type-hint/&quot; class=&quot;ref-link&quot;&gt;&lt;strong&gt;type hint&lt;/strong&gt;&lt;/a&gt;, you place a &lt;code&gt;-&amp;gt;&lt;/code&gt; after a function’s parameter list and write the expected return type before the colon.&lt;/p&gt;
&lt;p&gt;You can also add type hints to function parameters. To do this, place a colon after the parameter’s name, followed by the expected type—for example, &lt;a href=&quot;/ref/builtin-types/int/&quot; class=&quot;ref-link&quot;&gt;&lt;code&gt;int&lt;/code&gt;&lt;/a&gt; or &lt;a href=&quot;/ref/builtin-types/str/&quot; class=&quot;ref-link&quot;&gt;&lt;code&gt;str&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&quot;basic-type-hint-examples&quot;&gt;Basic Type Hint Examples&lt;a class=&quot;headerlink&quot; href=&quot;#basic-type-hint-examples&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;To further explore type hints, suppose that you’re creating a Python application to manage inventory for a video game store. The program stores a list of game titles, tracks how many copies are in stock, and suggests new games for customers to try.&lt;/p&gt;
&lt;p&gt;You’ve already seen the type hint syntax in the code example introduced earlier, which returns the number of titles in a list of games that the game store carries:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;pycon&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--blue&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Python&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; role=&quot;button&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;get_number_of_titles&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;titles&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;... &lt;/span&gt;    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;len&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;titles&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;...&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;games&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Dragon Quest&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Final Fantasy&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Age of Empires&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Number of titles:&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;get_number_of_titles&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;games&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;Number of titles: 3&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;Here you see a type hint. You define a function called &lt;code&gt;get_number_of_titles()&lt;/code&gt;, which takes a list of game titles as input. Next, you add a type hint for the &lt;code&gt;titles&lt;/code&gt; parameter, indicating that the function takes a list of strings. Finally, you also add another type hint for the return type, specifying that the function returns an &lt;a href=&quot;/ref/builtin-types/int/&quot; class=&quot;ref-link&quot;&gt;&lt;code&gt;int&lt;/code&gt;&lt;/a&gt; value. &lt;/p&gt;
&lt;p&gt;The function returns the length of the list, which is an integer. You test this out in the next line, where you create a variable that stores a list of three game titles. When you invoke the function on the list, you verify that the output is &lt;code&gt;3&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Note that in a real-world application, creating a separate function just to return a list’s length might be redundant. However, for instructional purposes, the function shown in the example is a straightforward way to demonstrate the type hint concept.&lt;/p&gt;
&lt;p&gt;You can use type hints with any Python type. You’ve already seen an example with an &lt;code&gt;int&lt;/code&gt; return type, but consider another example with a &lt;a href=&quot;/ref/builtin-types/str/&quot; class=&quot;ref-link&quot;&gt;&lt;code&gt;str&lt;/code&gt;&lt;/a&gt; return type. Suppose you want to recommend a random game for a customer to try. You could do so with the following short example function:&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/what-does-arrow-mean-in-python/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/what-does-arrow-mean-in-python/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #265: Python App Hosting Choices &amp; Documenting Python&#x27;s History</title>
      <id>https://realpython.com/podcasts/rpp/265/</id>
      <link href="https://realpython.com/podcasts/rpp/265/"/>
      <updated>2025-09-12T12:00:00+00:00</updated>
      <summary>What are your options for hosting your Python application or scripts? What are the advantages of a platform as a service, container-based hosts, or setting up a virtual machine? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder&#x27;s Weekly articles and projects.</summary>
      <content type="html">
        &lt;p&gt;What are your options for hosting your Python application or scripts? What are the advantages of a platform as a service, container-based hosts, or setting up a virtual machine? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder&#x27;s Weekly articles and projects.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>How to Drop Null Values in pandas With .dropna()</title>
      <id>https://realpython.com/how-to-drop-null-values-in-pandas/</id>
      <link href="https://realpython.com/how-to-drop-null-values-in-pandas/"/>
      <updated>2025-09-10T14:00:00+00:00</updated>
      <summary>Learn how to use .dropna() to drop null values from pandas DataFrames so you can clean missing data and keep your Python analysis accurate.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Missing values can derail your analysis. In pandas, you can use the &lt;code&gt;.dropna()&lt;/code&gt; method to remove rows or columns containing null values—in other words, missing data—so you can work with clean DataFrames. In this tutorial, you’ll learn how this method’s parameters let you control exactly which data gets removed. As you’ll see, these parameters give you fine-grained control over how much of your data to clean.&lt;/p&gt;
&lt;p&gt;Dealing with null values is essential for keeping datasets clean and avoiding the issues they can cause. Missing entries can lead to misinterpreted column data types, inaccurate conclusions, and errors in calculations. Simply put, nulls can cause havoc if they find their way into your calculations.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this tutorial, you’ll understand that:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You can use &lt;strong&gt;&lt;code&gt;.dropna()&lt;/code&gt;&lt;/strong&gt; to &lt;strong&gt;remove rows and columns&lt;/strong&gt; from a pandas DataFrame.&lt;/li&gt;
&lt;li&gt;You can remove rows and columns based on the &lt;strong&gt;content of a subset&lt;/strong&gt; of your DataFrame.&lt;/li&gt;
&lt;li&gt;You can remove rows and columns based on the &lt;strong&gt;volume of null values&lt;/strong&gt; within your DataFrame.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To get the most out of this tutorial, it’s recommended that you already have a basic understanding of how to create &lt;a href=&quot;https://realpython.com/pandas-dataframe/&quot;&gt;pandas DataFrames&lt;/a&gt; from files.&lt;/p&gt;
&lt;p&gt;You’ll use the Python &lt;a href=&quot;/ref/glossary/repl/&quot; class=&quot;ref-link&quot;&gt;REPL&lt;/a&gt; along with a file named &lt;code&gt;sales_data_with_missing_values.csv&lt;/code&gt;, which contains several null values you’ll deal with during the exercises. Before you start, extract this file from the downloadable materials by clicking the link at the end of this section. &lt;/p&gt;
&lt;p&gt;The &lt;code&gt;sales_data_with_missing_values.csv&lt;/code&gt; file is based on the publicly available and complete &lt;a href=&quot;https://www.kaggle.com/datasets/satyamanidharv/sales-data-presentation-dashboards?resource=download&quot;&gt;sales data&lt;/a&gt; file from &lt;a href=&quot;https://www.kaggle.com/&quot;&gt;Kaggle&lt;/a&gt;. Understanding the file’s content isn’t essential for this tutorial, but you can explore the Kaggle link above for more details if you’d like.&lt;/p&gt;
&lt;p&gt;You’ll also need to install both the pandas and PyArrow libraries to make sure all code examples work in your environment:&lt;/p&gt;
&lt;ul class=&quot;nav nav-tabs justify-content-end js-platform-widget-tabs&quot; role=&quot;tablist&quot;&gt;

  &lt;li class=&quot;nav-item mb-0 js-platform-widget-tab-windows&quot; role=&quot;presentation&quot;&gt;
    &lt;a class=&quot;nav-link link-unstyled text-body active small&quot; id=&quot;windows-tab-1&quot; data-toggle=&quot;tab&quot; href=&quot;#windows-1&quot; role=&quot;tab&quot; aria-controls=&quot;windows-1&quot; aria-selected=&quot;true&quot;&gt;&lt;span class=&quot;icon baseline text-muted mr-1&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#brands--windows&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Windows&lt;/a&gt;
  &lt;/li&gt;




  &lt;li class=&quot;nav-item mb-0 js-platform-widget-tab-linuxmacos&quot; role=&quot;presentation&quot;&gt;
    &lt;a class=&quot;nav-link link-unstyled text-body small&quot; id=&quot;macos-tab-1&quot; data-toggle=&quot;tab&quot; href=&quot;#linux-macos-1&quot; role=&quot;tab&quot; aria-controls=&quot;linux-macos-1&quot; aria-selected=&quot;false&quot;&gt;&lt;span class=&quot;icon baseline text-muted&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#v4--linux&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;span class=&quot;icon baseline text-muted mr-1&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#v4--apple&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Linux + macOS&lt;/a&gt;
  &lt;/li&gt;

&lt;/ul&gt;
&lt;div class=&quot;tab-content mt-2 mb-0 js-platform-widget-content&quot;&gt;
&lt;div aria-labelledby=&quot;windows-tab-1&quot; class=&quot;tab-pane fade show active&quot; id=&quot;windows-1&quot; role=&quot;tabpanel&quot;&gt;
&lt;code-block class=&quot;mb-3&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;pscon&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--yellow&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Windows PowerShell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; role=&quot;button&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;PS&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;python&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;-m&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pip&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;install&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pandas&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pyarrow&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;/div&gt;
&lt;div aria-labelledby=&quot;linux-macos-tab-1&quot; class=&quot;tab-pane fade &quot; id=&quot;linux-macos-1&quot; role=&quot;tabpanel&quot;&gt;
&lt;code-block class=&quot;mb-3&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;console&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--yellow&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Shell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; role=&quot;button&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;python&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;-m&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;pip&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;install&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;pandas&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;pyarrow
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;It’s time to refine your pandas skills by learning how to handle missing data in a variety of ways.&lt;/p&gt;
&lt;p&gt;You’ll find all code examples and the &lt;code&gt;sales_data_with_missing_values.csv&lt;/code&gt; file in the materials for this tutorial, which you can download by clicking the link below:&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown&gt;Get Your Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/how-to-drop-null-values-in-pandas-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-how-to-drop-null-values-in-pandas-code&quot; markdown&gt;Click here to download the free sample code&lt;/a&gt; that you’ll use to learn how to drop null values in pandas.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;container border rounded text-wrap-pretty my-3&quot;&gt;

  &lt;p class=&quot;my-3&quot;&gt;&lt;mark class=&quot;marker-highlight&quot;&gt;&lt;strong&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt; Take the Quiz:&lt;/strong&gt;&lt;/mark&gt; Test your knowledge with our interactive “How to Drop Null Values in pandas” quiz. You’ll receive a score upon completion to help you track your learning progress:&lt;/p&gt;

  &lt;hr&gt;

  &lt;div class=&quot;row my-3&quot;&gt;
    &lt;div class=&quot;col-xs-12 col-sm-4 col-md-3 align-self-center&quot;&gt;

      &lt;a href=&quot;/quizzes/how-to-drop-null-values-in-pandas/&quot; tabindex=&quot;-1&quot;&gt;
        &lt;div class=&quot;embed-responsive embed-responsive-16by9&quot;&gt;

            &lt;img class=&quot;card-img-top m-0 p-0 embed-responsive-item rounded&quot; style=&quot;object-fit: contain; background: #b9abe6;&quot; alt=&quot;How to Drop Null Values in pandas&quot; src=&quot;https://files.realpython.com/media/How-to-Drop-Null-Values-in-Pandas_Watermarked.f06e0d54bea4.jpg&quot; width=&quot;1920&quot; height=&quot;1080&quot; srcset=&quot;/cdn-cgi/image/width=480,format=auto/https://files.realpython.com/media/How-to-Drop-Null-Values-in-Pandas_Watermarked.f06e0d54bea4.jpg 480w, /cdn-cgi/image/width=640,format=auto/https://files.realpython.com/media/How-to-Drop-Null-Values-in-Pandas_Watermarked.f06e0d54bea4.jpg 640w, /cdn-cgi/image/width=960,format=auto/https://files.realpython.com/media/How-to-Drop-Null-Values-in-Pandas_Watermarked.f06e0d54bea4.jpg 960w, /cdn-cgi/image/width=1920,format=auto/https://files.realpython.com/media/How-to-Drop-Null-Values-in-Pandas_Watermarked.f06e0d54bea4.jpg 1920w&quot; sizes=&quot;(min-width: 1200px) 142px, (min-width: 1000px) 122px, (min-width: 780px) 112px, (min-width: 580px) 139px, calc(100vw - 62px)&quot;&gt;


          &lt;div class=&quot;card-img-overlay d-flex align-items-center&quot;&gt;
            &lt;div class=&quot;mx-auto&quot;&gt;
              &lt;span class=&quot;text-light&quot; style=&quot;opacity: 0.90;&quot;&gt;&lt;span class=&quot;icon baseline scale2x&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/a&gt;

    &lt;/div&gt;
    &lt;div class=&quot;col&quot;&gt;
      &lt;div class=&quot;mt-3 d-md-none&quot;&gt;&lt;/div&gt; 
      &lt;p class=&quot;small text-muted mb-0&quot;&gt;&lt;strong&gt;Interactive Quiz&lt;/strong&gt;&lt;/p&gt;
      &lt;a href=&quot;/quizzes/how-to-drop-null-values-in-pandas/&quot; class=&quot;stretched-link&quot;&gt;&lt;span class=&quot;my-0 h4&quot;&gt;How to Drop Null Values in pandas&lt;/span&gt;&lt;/a&gt; 
      &lt;p class=&quot;text-muted mb-0 small&quot;&gt;Quiz yourself on pandas .dropna(): remove nulls, clean missing data, and prepare DataFrames for accurate analysis.&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;

&lt;/div&gt;

&lt;h2 id=&quot;how-to-drop-rows-containing-null-values-with-pandas-dropna&quot;&gt;How to Drop Rows Containing Null Values With pandas &lt;code&gt;.dropna()&lt;/code&gt;&lt;a class=&quot;headerlink&quot; href=&quot;#how-to-drop-rows-containing-null-values-with-pandas-dropna&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Before you start dropping rows, it’s helpful to know what options &lt;code&gt;.dropna()&lt;/code&gt; gives you. This method supports six &lt;strong&gt;parameters&lt;/strong&gt; that let you control exactly what’s removed:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;axis&lt;/code&gt;&lt;/strong&gt;: Specifies whether to remove rows or columns containing null values.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;thresh&lt;/code&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;code&gt;how&lt;/code&gt;&lt;/strong&gt;: Define how many missing values to remove or retain.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;subset&lt;/code&gt;&lt;/strong&gt;: Limits the removal of null values to specific parts of your DataFrame.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;inplace&lt;/code&gt;&lt;/strong&gt;: Determines whether the operation modifies the original DataFrame or returns a new copy.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;ignore_index&lt;/code&gt;&lt;/strong&gt;: Resets the DataFrame index after removing rows.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Don’t worry if any of these parameters don’t make sense to you just yet—you’ll learn why each is used during this tutorial. You’ll also get the chance to practice your skills.&lt;/p&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Although this tutorial teaches you how pandas DataFrames use &lt;code&gt;.dropna()&lt;/code&gt;, DataFrames aren’t the only pandas objects that use it.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://pandas.pydata.org/docs/reference/series.html&quot;&gt;Series&lt;/a&gt; objects also have their own &lt;a href=&quot;https://pandas.pydata.org/docs/reference/api/pandas.Series.dropna.html&quot;&gt;&lt;code&gt;.dropna()&lt;/code&gt;&lt;/a&gt; method. However, the Series version contains only four parameters—&lt;code&gt;axis&lt;/code&gt;, &lt;code&gt;inplace&lt;/code&gt;, &lt;code&gt;how&lt;/code&gt;, and &lt;code&gt;ignore_index&lt;/code&gt;—instead of the six supported by the DataFrame version. Of these, only &lt;code&gt;inplace&lt;/code&gt; and &lt;code&gt;ignore_index&lt;/code&gt; are used, and they work the same way as in the DataFrame method. The rest are kept for compatibility with DataFrame, but have no effect.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://pandas.pydata.org/docs/reference/indexing.html&quot;&gt;Indexes&lt;/a&gt; also have a &lt;a href=&quot;https://pandas.pydata.org/docs/reference/api/pandas.Index.dropna.html&quot;&gt;&lt;code&gt;.dropna()&lt;/code&gt;&lt;/a&gt; method for removing missing index values, and it contains just one parameter: &lt;code&gt;how&lt;/code&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Before using &lt;code&gt;.dropna()&lt;/code&gt; to drop rows, you should first find out whether your data contains any &lt;a href=&quot;https://realpython.com/null-in-python/&quot;&gt;null values&lt;/a&gt;:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;pycon&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--blue&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Python&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; role=&quot;button&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nn&quot;&gt;pandas&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;as&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nn&quot;&gt;pd&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pd&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;set_option&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;display.max_columns&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;None&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sales_data&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pd&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;read_csv&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;... &lt;/span&gt;    &lt;span class=&quot;s2&quot;&gt;&quot;sales_data_with_missing_values.csv&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;... &lt;/span&gt;    &lt;span class=&quot;n&quot;&gt;parse_dates&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;order_date&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;... &lt;/span&gt;    &lt;span class=&quot;n&quot;&gt;date_format&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;%d&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/%m/%Y&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;... &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;convert_dtypes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dtype_backend&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;pyarrow&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sales_data&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;    order_number           order_date       customer_name  \&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;0           &amp;lt;NA&amp;gt;  2025-02-09 00:00:00      Skipton Fealty&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;1          70041                 &amp;lt;NA&amp;gt;  Carmine Priestnall&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;2          70042  2025-02-09 00:00:00                &amp;lt;NA&amp;gt;&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;3          70043  2025-02-10 00:00:00     Lanni D&#x27;Ambrogi&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;4          70044  2025-02-10 00:00:00         Tann Angear&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;5          70045  2025-02-10 00:00:00      Skipton Fealty&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;6          70046  2025-02-11 00:00:00             Far Pow&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;7          70047  2025-02-11 00:00:00          Hill Group&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;8          70048  2025-02-11 00:00:00         Devlin Nock&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;9           &amp;lt;NA&amp;gt;                 &amp;lt;NA&amp;gt;                &amp;lt;NA&amp;gt;&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;10         70049  2025-02-12 00:00:00           Swift Inc&lt;/span&gt;

&lt;span class=&quot;go&quot;&gt;                product_purchased discount  sale_price&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;0    Chili Extra Virgin Olive Oil     True       135.0&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;1                            &amp;lt;NA&amp;gt;     &amp;lt;NA&amp;gt;       150.0&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;2       Rosemary Olive Oil Candle    False        78.0&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;3                            &amp;lt;NA&amp;gt;     True        19.5&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;4    Vanilla and Olive Oil Candle     &amp;lt;NA&amp;gt;       13.98&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;5    Basil Extra Virgin Olive Oil     True        &amp;lt;NA&amp;gt;&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;6    Chili Extra Virgin Olive Oil    False       150.0&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;7    Chili Extra Virgin Olive Oil     True       135.0&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;8   Lavender and Olive Oil Lotion    False       39.96&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;9                            &amp;lt;NA&amp;gt;     &amp;lt;NA&amp;gt;        &amp;lt;NA&amp;gt;&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;10  Garlic Extra Virgin Olive Oil     True       936.0&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.c6ded8df2bdc.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;To make sure all columns appear on your screen, you configure &lt;code&gt;pd.set_option(&quot;display.max_columns&quot;, None)&lt;/code&gt;. By passing &lt;code&gt;None&lt;/code&gt; as the second parameter, you make sure all columns are displayed.&lt;/p&gt;
&lt;p&gt;You read the &lt;code&gt;sales_data_with_missing_values.csv&lt;/code&gt; file into a DataFrame using the &lt;a href=&quot;https://realpython.com/pandas-read-write-files/#read-a-csv-file&quot;&gt;pandas &lt;code&gt;read_csv()&lt;/code&gt;&lt;/a&gt; function, then view the data. The order dates are in the &lt;code&gt;&quot;%d/%m/%Y&quot;&lt;/code&gt; format in the file, so to make sure the &lt;code&gt;order_date&lt;/code&gt; data is read correctly, you use both the &lt;code&gt;parse_dates&lt;/code&gt; and &lt;code&gt;date_format&lt;/code&gt; parameters. The output reveals there are ten rows and six columns of data in your file.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/how-to-drop-null-values-in-pandas/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/how-to-drop-null-values-in-pandas/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Python String Splitting</title>
      <id>https://realpython.com/courses/python-string-splitting/</id>
      <link href="https://realpython.com/courses/python-string-splitting/"/>
      <updated>2025-09-09T14:00:00+00:00</updated>
      <summary>Master Python string splitting with .split() and re.split() to handle whitespace, delimiters and multiline text.</summary>
      <content type="html">
        &lt;p&gt;Python&amp;rsquo;s &lt;code&gt;.split()&lt;/code&gt; method lets you divide a string into a list of substrings based on a specified delimiter. By default, &lt;code&gt;.split()&lt;/code&gt; separates at whitespace, including spaces, tabs, and newlines. You can customize &lt;code&gt;.split()&lt;/code&gt; to work with specific delimiters using the &lt;code&gt;sep&lt;/code&gt; parameter, and control the amount of splits with &lt;code&gt;maxsplit&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this video course, you&amp;rsquo;ll understand that:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You &lt;strong&gt;split a string by spaces&lt;/strong&gt; in Python using &lt;strong&gt;&lt;code&gt;.split()&lt;/code&gt; without arguments&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Python&amp;rsquo;s &lt;code&gt;.split()&lt;/code&gt; method can split on &lt;strong&gt;custom delimiters&lt;/strong&gt; when you pass a character or string as an argument.&lt;/li&gt;
&lt;li&gt;You &lt;strong&gt;limit splits using &lt;code&gt;maxsplit&lt;/code&gt;&lt;/strong&gt; to control the number of substrings Python extracts.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;re.split()&lt;/code&gt; uses &lt;strong&gt;regular expressions&lt;/strong&gt; for splitting strings based on complex patterns.&lt;/li&gt;
&lt;/ul&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Python Documentary Celebrates History While Developer Surveys Celebrate Python</title>
      <id>https://realpython.com/python-news-september-2025/</id>
      <link href="https://realpython.com/python-news-september-2025/"/>
      <updated>2025-09-08T14:00:00+00:00</updated>
      <summary>The Python documentary debuts! Explore Python&#x27;s journey, 2025 survey results, explosive growth, and key September news updates.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Python is making history, and headlines. The much-anticipated &lt;strong&gt;&lt;em&gt;Python: The Documentary&lt;/em&gt;&lt;/strong&gt; premiered last month, capturing 34 years of programming history. But Python isn’t just looking back, it’s also moving forward at breakneck speed. &lt;/p&gt;
&lt;p&gt;The recent developer surveys revealed Python’s explosive growth. At the same time, the Python Software Foundation paused its grants program amid unprecedented demand, PyPI implemented multiple security enhancements, while JetBrains announced a transition for PyCharm Community Edition into a unified product model.&lt;/p&gt;
&lt;p&gt;Here’s what’s been happening in the world of Python!&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown&gt;Join Now:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/newsletter/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-newsletter&quot; markdown&gt;Click here to join the Real Python Newsletter&lt;/a&gt; and you’ll never miss another Python tutorial, course, or news update.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;the-python-documentary-is-now-available-on-youtube&quot;&gt;The Python Documentary Is Now Available on YouTube&lt;a class=&quot;headerlink&quot; href=&quot;#the-python-documentary-is-now-available-on-youtube&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;At the end of August, &lt;a href=&quot;https://www.youtube.com/watch?v=GfH4QL4VqJ0&quot;&gt;&lt;em&gt;Python: The Documentary&lt;/em&gt;&lt;/a&gt; premiered on YouTube, where you can watch it for free. It’s an 84-minute film tracing Python’s journey from Amsterdam side project to the world’s most popular programming language: &lt;/p&gt;
&lt;div class=&quot;embed-responsive embed-responsive-16by9 rounded mb-3&quot;&gt;&lt;iframe loading=&quot;lazy&quot; class=&quot;embed-responsive-item rounded&quot; type=&quot;text/html&quot; src=&quot;https://www.youtube.com/embed/GfH4QL4VqJ0?autoplay=1&amp;amp;modestbranding=1&amp;amp;rel=0&amp;amp;showinfo=0&amp;amp;origin=https://realpython.com&quot; frameborder=&quot;0&quot; allowfullscreen allow=&quot;accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture&quot; title=&quot;Embedded video (click to play)&quot; srcdoc=&quot;&amp;lt;style&amp;gt;*{padding:0;margin:0;overflow:hidden}html,body{height:100%}img,span{position:absolute;width:100%;top:0;bottom:0;margin:auto}.play{height:25%;opacity:0.6;};&amp;lt;/style&amp;gt;&amp;lt;a href=&#x27;https://www.youtube.com/embed/GfH4QL4VqJ0?autoplay=1&amp;amp;modestbranding=1&amp;amp;rel=0&amp;amp;showinfo=0&amp;amp;origin=https://realpython.com&#x27;&amp;gt;&amp;lt;img src=&#x27;https://img.youtube.com/vi/GfH4QL4VqJ0/hqdefault.jpg&#x27; alt=&#x27;Video Thumbnail&#x27;&amp;gt;&amp;lt;img class=&#x27;play&#x27; src=&#x27;data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzODQgNTEyIj48cGF0aCBkPSJNNzMgMzljLTE0LjgtOS4xLTMzLjQtOS40LTQ4LjUtLjlTMCA2Mi42IDAgODBWNDMyYzAgMTcuNCA5LjQgMzMuNCAyNC41IDQxLjlzMzMuNyA4LjEgNDguNS0uOUwzNjEgMjk3YzE0LjMtOC43IDIzLTI0LjIgMjMtNDFzLTguNy0zMi4yLTIzLTQxTDczIDM5eiIgZmlsbD0iI2ZmZiIvPjwvc3ZnPg==&#x27;&amp;gt;&amp;lt;/a&amp;gt;&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;

&lt;p&gt;Produced by &lt;a href=&quot;https://www.youtube.com/@cultrepo&quot;&gt;CultRepo (formerly Honeypot)&lt;/a&gt; and directed by Ida Bechtle, the documentary explores Python’s evolution and the community that shaped it. It features &lt;a href=&quot;/ref/glossary/bdfl/&quot; class=&quot;ref-link&quot;&gt;Guido van Rossum&lt;/a&gt; and key contributors like &lt;a href=&quot;https://mariatta.ca/&quot;&gt;Mariatta&lt;/a&gt; and recent &lt;a href=&quot;https://realpython.com/podcasts/rpp/262/&quot;&gt;Real Python Podcast guest, Travis Oliphant&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;The documentary also highlights the important role of &lt;a href=&quot;https://pyladies.com/&quot;&gt;PyLadies&lt;/a&gt; and addresses controversial topics including the Python 2 to 3 transition.&lt;/p&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; If you want to take a deep dive into Python’s version history, then check out &lt;a href=&quot;https://realpython.com/courses/history-python-versions-features/&quot;&gt;A History of Python Versions and Features&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;The timing of &lt;em&gt;Python: The Documentary&lt;/em&gt; couldn’t be better. While the film celebrates past achievements, the latest developer surveys show Python continues to thrive.&lt;/p&gt;
&lt;h2 id=&quot;developer-surveys-reveal-pythons-explosive-growth&quot;&gt;Developer Surveys Reveal Python’s Explosive Growth&lt;a class=&quot;headerlink&quot; href=&quot;#developer-surveys-reveal-pythons-explosive-growth&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://blog.jetbrains.com/pycharm/2025/08/the-state-of-python-2025/&quot;&gt;JetBrains The State of Python 2025&lt;/a&gt; and the &lt;a href=&quot;https://stackoverflow.blog/2025/08/01/diving-into-the-results-of-the-2025-developer-survey/?lid=drihiki0rm4n&quot;&gt;Stack Overflow 2025 Developer Survey&lt;/a&gt; revealed Python’s remarkable growth:&lt;/p&gt;
&lt;figure class=&quot;&quot;&gt;&lt;img loading=&quot;lazy&quot; class=&quot;img-fluid mx-auto d-block &quot; src=&quot;https://files.realpython.com/media/python_survey_2025_1.0282de628f2e.png&quot; width=&quot;1078&quot; height=&quot;504&quot; srcset=&quot;/cdn-cgi/image/width=269,format=auto/https://files.realpython.com/media/python_survey_2025_1.0282de628f2e.png 269w, /cdn-cgi/image/width=359,format=auto/https://files.realpython.com/media/python_survey_2025_1.0282de628f2e.png 359w, /cdn-cgi/image/width=539,format=auto/https://files.realpython.com/media/python_survey_2025_1.0282de628f2e.png 539w, /cdn-cgi/image/width=1078,format=auto/https://files.realpython.com/media/python_survey_2025_1.0282de628f2e.png 1078w&quot; sizes=&quot;(min-width: 1200px) 690px, (min-width: 780px) calc(-5vw + 669px), (min-width: 580px) 510px, calc(100vw - 30px)&quot; alt=&quot;Screenshot of the SO programming language survey showing Python at 57.9%&quot; data-asset=&quot;6516&quot;&gt;&lt;figcaption class=&quot;figure-caption text-center&quot;&gt;Image: &lt;a href=&quot;https://survey.stackoverflow.co/2025/technology#most-popular-technologies&quot; target=&quot;_blank&quot;&gt;Most Popular Technologies 2025&lt;/a&gt;&lt;/figcaption&gt;&lt;/figure&gt;

&lt;p&gt;Python usage jumped &lt;strong&gt;seven percentage points&lt;/strong&gt; to reach &lt;strong&gt;57.9%&lt;/strong&gt; of all developers, marking one of the largest year-over-year gains for any established language. Another exciting survey result is that &lt;strong&gt;50%&lt;/strong&gt; of respondents have &lt;strong&gt;two years or less&lt;/strong&gt; of professional coding experience:&lt;/p&gt;
&lt;figure class=&quot;&quot;&gt;&lt;img loading=&quot;lazy&quot; class=&quot;img-fluid mx-auto d-block &quot; src=&quot;https://files.realpython.com/media/python_survey_2025_4.43b497b742fb.png&quot; width=&quot;1814&quot; height=&quot;1156&quot; srcset=&quot;/cdn-cgi/image/width=453,format=auto/https://files.realpython.com/media/python_survey_2025_4.43b497b742fb.png 453w, /cdn-cgi/image/width=604,format=auto/https://files.realpython.com/media/python_survey_2025_4.43b497b742fb.png 604w, /cdn-cgi/image/width=907,format=auto/https://files.realpython.com/media/python_survey_2025_4.43b497b742fb.png 907w, /cdn-cgi/image/width=1814,format=auto/https://files.realpython.com/media/python_survey_2025_4.43b497b742fb.png 1814w&quot; sizes=&quot;(min-width: 1200px) 690px, (min-width: 780px) calc(-5vw + 669px), (min-width: 580px) 510px, calc(100vw - 30px)&quot; alt=&quot;Screenshot of the JetBrains surves showing most Python developers are beginners&quot; data-asset=&quot;6520&quot;&gt;&lt;figcaption class=&quot;figure-caption text-center&quot;&gt;Image: &lt;a href=&quot;https://blog.jetbrains.com/pycharm/2025/08/the-state-of-python-2025/#we-are-mostly-brand-new-programmers&quot; target=&quot;_blank&quot;&gt;Years of Python Experience 2025&lt;/a&gt;&lt;/figcaption&gt;&lt;/figure&gt;

&lt;p&gt;If you’re one of them and want to get started with Python, then this &lt;a href=&quot;https://realpython.com/learning-paths/python-basics/&quot;&gt;Introduction to Python Learning Path&lt;/a&gt; is perfect for you. One of the positively surprising results of the Stack Overflow survey is that &lt;a href=&quot;https://docs.astral.sh/uv/guides/install-python/&quot;&gt;&lt;code&gt;uv&lt;/code&gt;&lt;/a&gt; came in first place as the &lt;a href=&quot;https://survey.stackoverflow.co/2025/technology#admired-and-desired&quot;&gt;most admired Stack Overflow tag&lt;/a&gt;:&lt;/p&gt;
&lt;figure class=&quot;&quot;&gt;&lt;img loading=&quot;lazy&quot; class=&quot;img-fluid mx-auto d-block &quot; src=&quot;https://files.realpython.com/media/python_survey_2025_2.d1bbb217ff84.png&quot; width=&quot;1018&quot; height=&quot;518&quot; srcset=&quot;/cdn-cgi/image/width=254,format=auto/https://files.realpython.com/media/python_survey_2025_2.d1bbb217ff84.png 254w, /cdn-cgi/image/width=339,format=auto/https://files.realpython.com/media/python_survey_2025_2.d1bbb217ff84.png 339w, /cdn-cgi/image/width=509,format=auto/https://files.realpython.com/media/python_survey_2025_2.d1bbb217ff84.png 509w, /cdn-cgi/image/width=1018,format=auto/https://files.realpython.com/media/python_survey_2025_2.d1bbb217ff84.png 1018w&quot; sizes=&quot;(min-width: 1200px) 690px, (min-width: 780px) calc(-5vw + 669px), (min-width: 580px) 510px, calc(100vw - 30px)&quot; alt=&quot;Screenshot of the SO surves showing uv as the most admired tag&quot; data-asset=&quot;6517&quot;&gt;&lt;figcaption class=&quot;figure-caption text-center&quot;&gt;Image: &lt;a href=&quot;https://survey.stackoverflow.co/2025/technology#admired-and-desired&quot; target=&quot;_blank&quot;&gt;Most Admired Technology Tag 2025&lt;/a&gt;&lt;/figcaption&gt;&lt;/figure&gt;

&lt;p&gt;If you want to give &lt;code&gt;uv&lt;/code&gt; a spin yourself, then you can check out the tutorials &lt;a href=&quot;https://realpython.com/python-uv/&quot;&gt;Managing Python Projects With uv&lt;/a&gt; and &lt;a href=&quot;https://realpython.com/uv-vs-pip/&quot;&gt;uv vs pip: Managing Python Packages and Dependencies&lt;/a&gt;. Another notable development is &lt;a href=&quot;https://fastapi.tiangolo.com/&quot;&gt;FastAPI’s&lt;/a&gt; jump in usage from &lt;strong&gt;29% to 38%&lt;/strong&gt; among Python developers:&lt;/p&gt;
&lt;figure class=&quot;&quot;&gt;&lt;img loading=&quot;lazy&quot; class=&quot;img-fluid mx-auto d-block &quot; src=&quot;https://files.realpython.com/media/python_survey_2025_3.d42078d863e7.png&quot; width=&quot;1814&quot; height=&quot;1108&quot; srcset=&quot;/cdn-cgi/image/width=453,format=auto/https://files.realpython.com/media/python_survey_2025_3.d42078d863e7.png 453w, /cdn-cgi/image/width=604,format=auto/https://files.realpython.com/media/python_survey_2025_3.d42078d863e7.png 604w, /cdn-cgi/image/width=907,format=auto/https://files.realpython.com/media/python_survey_2025_3.d42078d863e7.png 907w, /cdn-cgi/image/width=1814,format=auto/https://files.realpython.com/media/python_survey_2025_3.d42078d863e7.png 1814w&quot; sizes=&quot;(min-width: 1200px) 690px, (min-width: 780px) calc(-5vw + 669px), (min-width: 580px) 510px, calc(100vw - 30px)&quot; alt=&quot;Screenshot of the JetBrains surves showing the rise of FastAPI&quot; data-asset=&quot;6518&quot;&gt;&lt;figcaption class=&quot;figure-caption text-center&quot;&gt;Image: &lt;a href=&quot;https://blog.jetbrains.com/pycharm/2025/08/the-state-of-python-2025/&quot; target=&quot;_blank&quot;&gt;Web Frameworks Usage 2025&lt;/a&gt;&lt;/figcaption&gt;&lt;/figure&gt;

&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-news-september-2025/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-news-september-2025/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #264: Large Language Models on the Edge of the Scaling Laws</title>
      <id>https://realpython.com/podcasts/rpp/264/</id>
      <link href="https://realpython.com/podcasts/rpp/264/"/>
      <updated>2025-09-05T12:00:00+00:00</updated>
      <summary>What&#x27;s happening with the latest releases of large language models? Is the industry hitting the edge of the scaling laws, and do the current benchmarks provide reliable performance assessments? This week on the show, Jodie Burchell returns to discuss the current state of LLM releases.</summary>
      <content type="html">
        &lt;p&gt;What&#x27;s happening with the latest releases of large language models? Is the industry hitting the edge of the scaling laws, and do the current benchmarks provide reliable performance assessments? This week on the show, Jodie Burchell returns to discuss the current state of LLM releases.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>A History of Python Versions and Features</title>
      <id>https://realpython.com/courses/history-python-versions-features/</id>
      <link href="https://realpython.com/courses/history-python-versions-features/"/>
      <updated>2025-09-02T14:00:00+00:00</updated>
      <summary>Explore Python’s evolution from the 1990s to today with a brief history and demos of key features added throughout its lifetime.</summary>
      <content type="html">
        &lt;p&gt;This course gives you a direct, practical overview of how Python has evolved&amp;mdash;what changed in each major version, why it matters, and how to use the features that define modern Python. You&amp;rsquo;ll see both the historical context and hands-on code, so you understand not just what changed, but why and how to use it today.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this course, you&amp;rsquo;ll learn:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Key new features introduced in every major Python version, starting from early Python 1 up to Python 3.14&lt;/li&gt;
&lt;li&gt;The story behind pivotal changes, like list comprehensions, exception handling, the &lt;code&gt;with&lt;/code&gt; statement, &lt;code&gt;defaultdict&lt;/code&gt;, and the transition from Python 2 to Python 3&lt;/li&gt;
&lt;li&gt;Hands-on use of modern Python tools: f-strings, dataclasses, the walrus operator (:=), match/case structural pattern matching, and new types like enum and pathlib&lt;/li&gt;
&lt;li&gt;How to leverage improvements in each Python release for cleaner, faster, and more maintainable code&lt;/li&gt;
&lt;li&gt;What&amp;rsquo;s coming in the latest Python releases, including t-strings and REPL improvements&lt;/li&gt;
&lt;/ul&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #263: Exploring Mixin Classes in Python</title>
      <id>https://realpython.com/podcasts/rpp/263/</id>
      <link href="https://realpython.com/podcasts/rpp/263/"/>
      <updated>2025-08-29T12:00:00+00:00</updated>
      <summary>What is a good way to add isolated, reusable functionality to Python classes? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder&#x27;s Weekly articles and projects.</summary>
      <content type="html">
        &lt;p&gt;What is a good way to add isolated, reusable functionality to Python classes? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder&#x27;s Weekly articles and projects.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Profiling Performance in Python</title>
      <id>https://realpython.com/courses/profiling-performance/</id>
      <link href="https://realpython.com/courses/profiling-performance/"/>
      <updated>2025-08-26T14:00:00+00:00</updated>
      <summary>Learn to profile Python programs with built-in and popular third-party tools, and turn performance insights into faster code.</summary>
      <content type="html">
        &lt;p&gt;Do you want to optimize the performance of your Python program to make it run faster or consume less memory? Before diving into any performance tuning, you should strongly consider using a technique called &lt;strong&gt;software profiling&lt;/strong&gt;. It can help you decide whether optimizing the code is necessary and, if so, which parts of the code you should focus on.&lt;/p&gt;
&lt;p&gt;Sometimes, the return on investment in performance optimizations just isn&amp;rsquo;t worth the effort. If you only run your code once or twice, or if it takes longer to improve the code than execute it, then what&amp;rsquo;s the point?&lt;/p&gt;
&lt;p&gt;When it comes to improving the quality of your code, you&amp;rsquo;ll probably optimize for performance as a final step, if you do it at all. Often, your code will become speedier and more memory efficient thanks to other changes that you make. When in doubt, go through this short checklist to figure out whether to work on performance:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;https://realpython.com/tutorials/testing/&quot;&gt;Testing&lt;/a&gt;: Have you tested your code to prove that it works as expected and without errors?&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://realpython.com/python-refactoring/&quot;&gt;Refactoring&lt;/a&gt;: Does your code need some cleanup to become more maintainable and &lt;a href=&quot;https://realpython.com/learning-paths/writing-pythonic-code/&quot;&gt;Pythonic&lt;/a&gt;?&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://realpython.com/python-timer/#finding-bottlenecks-in-your-code-with-profilers&quot;&gt;Profiling&lt;/a&gt;: Have you identified the most inefficient parts of your code?&lt;/li&gt;
&lt;/ol&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #262: Travis Oliphant: SciPy, NumPy, and Fostering Scientific Python</title>
      <id>https://realpython.com/podcasts/rpp/262/</id>
      <link href="https://realpython.com/podcasts/rpp/262/"/>
      <updated>2025-08-22T12:00:00+00:00</updated>
      <summary>What went into developing the open-source Python tools data scientists use every day? This week on the show, we talk with Travis Oliphant about his work on SciPy, NumPy, Numba, and many other contributions to the Python scientific community.</summary>
      <content type="html">
        &lt;p&gt;What went into developing the open-source Python tools data scientists use every day? This week on the show, we talk with Travis Oliphant about his work on SciPy, NumPy, Numba, and many other contributions to the Python scientific community.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Deep vs Shallow Copies in Python</title>
      <id>https://realpython.com/courses/deep-vs-shallow-copies/</id>
      <link href="https://realpython.com/courses/deep-vs-shallow-copies/"/>
      <updated>2025-08-19T14:00:00+00:00</updated>
      <summary>Understand the difference between shallow and deep copies in Python. Learn how to duplicate objects safely using the copy module and other techniques.</summary>
      <content type="html">
        &lt;p&gt;When working with Python objects, you&amp;rsquo;ll often need to make copies rather than modify the originals. In this video course, you&amp;rsquo;ll explore various ways to copy objects in Python, including using the built-in &lt;code&gt;copy&lt;/code&gt; module. You&amp;rsquo;ll also learn the key differences between shallow and deep copies, with practical examples so you can safely duplicate objects in your own code.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this video course, you&amp;rsquo;ll understand that:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Shallow copying&lt;/strong&gt; creates a new object but references the same nested objects, leading to shared changes.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Deep copying&lt;/strong&gt; recursively duplicates all objects, ensuring full independence from the original.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Python&amp;rsquo;s &lt;code&gt;copy&lt;/code&gt; module&lt;/strong&gt; provides the &lt;code&gt;copy()&lt;/code&gt; function for shallow copies and &lt;code&gt;deepcopy()&lt;/code&gt; for deep copies.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Custom classes&lt;/strong&gt; can implement &lt;code&gt;.__copy__()&lt;/code&gt; and &lt;code&gt;.__deepcopy__()&lt;/code&gt; for specific copying behavior.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Assignment in Python&lt;/strong&gt; binds variable names to objects without copying, unlike some lower-level languages.&lt;/li&gt;
&lt;/ul&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #261: Selecting Inheritance or Composition in Python</title>
      <id>https://realpython.com/podcasts/rpp/261/</id>
      <link href="https://realpython.com/podcasts/rpp/261/"/>
      <updated>2025-08-15T12:00:00+00:00</updated>
      <summary>When considering an object-oriented programming problem, should you prefer inheritance or composition? Why wouldn&#x27;t it just be simpler to use functions? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder&#x27;s Weekly articles and projects.</summary>
      <content type="html">
        &lt;p&gt;When considering an object-oriented programming problem, should you prefer inheritance or composition? Why wouldn&#x27;t it just be simpler to use functions? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder&#x27;s Weekly articles and projects.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Working With Python&#x27;s .__dict__ Attribute</title>
      <id>https://realpython.com/courses/working-dict-attributes/</id>
      <link href="https://realpython.com/courses/working-dict-attributes/"/>
      <updated>2025-08-12T14:00:00+00:00</updated>
      <summary>Explore Python&#x27;s .__dict__ attribute to manage class and instance attributes directly for more flexible, low-level control of your objects.</summary>
      <content type="html">
        &lt;p&gt;Python&amp;rsquo;s &lt;code&gt;.__dict__&lt;/code&gt; is a special attribute in classes and instances that acts as a namespace, mapping attribute names to their corresponding values. You can use &lt;code&gt;.__dict__&lt;/code&gt; to inspect, modify, add, or delete attributes dynamically, which makes it a versatile tool for metaprogramming and debugging.&lt;/p&gt;
&lt;p&gt;In this video course, you&amp;rsquo;ll learn about using &lt;code&gt;.__dict__&lt;/code&gt; in various contexts, including classes, instances, and functions. You&amp;rsquo;ll also explore its role in inheritance with practical examples and comparisons to other tools for manipulating attributes.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this video course, you&amp;rsquo;ll understand that:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;.__dict__&lt;/code&gt;&lt;/strong&gt; holds an object&amp;rsquo;s &lt;strong&gt;writable attributes&lt;/strong&gt;, allowing for dynamic manipulation and introspection.&lt;/li&gt;
&lt;li&gt;Both &lt;strong&gt;&lt;code&gt;vars()&lt;/code&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;code&gt;.__dict__&lt;/code&gt;&lt;/strong&gt; let you &lt;strong&gt;inspect&lt;/strong&gt; an object&amp;rsquo;s attributes. The &lt;code&gt;.__dict__&lt;/code&gt; attribute gives you direct access to the object&amp;rsquo;s namespace, while the &lt;code&gt;vars()&lt;/code&gt; function returns the object&amp;rsquo;s &lt;code&gt;.__dict__&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Common use cases of &lt;code&gt;.__dict__&lt;/code&gt; include &lt;strong&gt;dynamic attribute management&lt;/strong&gt;, &lt;strong&gt;introspection&lt;/strong&gt;, &lt;strong&gt;serialization&lt;/strong&gt;, and &lt;strong&gt;debugging&lt;/strong&gt; in Python applications.&lt;/li&gt;
&lt;/ul&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #260: Harnessing the Power of Python Polars</title>
      <id>https://realpython.com/podcasts/rpp/260/</id>
      <link href="https://realpython.com/podcasts/rpp/260/"/>
      <updated>2025-08-08T12:00:00+00:00</updated>
      <summary>What are the advantages of using Polars for your Python data projects? When should you use the lazy or eager APIs, and what are the benefits of each? This week on the show, we speak with Jeroen Janssens and Thijs Nieuwdorp about their new book, _Python Polars: The Definitive Guide_.</summary>
      <content type="html">
        &lt;p&gt;What are the advantages of using Polars for your Python data projects? When should you use the lazy or eager APIs, and what are the benefits of each? This week on the show, we speak with Jeroen Janssens and Thijs Nieuwdorp about their new book, _Python Polars: The Definitive Guide_.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Exploring Python T-Strings</title>
      <id>https://realpython.com/courses/exploring-t-strings/</id>
      <link href="https://realpython.com/courses/exploring-t-strings/"/>
      <updated>2025-08-05T14:00:00+00:00</updated>
      <summary>Python 3.14 introduces t-strings: a safer, more flexible alternative to f-strings. Learn how to process templates securely and customize string workflows.</summary>
      <content type="html">
        &lt;p&gt;Python 3.14&amp;rsquo;s t-strings allow you to intercept and transform input values before assembling them into a final representation. Unlike f-strings, which produce a &lt;code&gt;str&lt;/code&gt; object, t-strings resolve to a &lt;code&gt;Template&lt;/code&gt; instance, allowing you to safely process and customize dynamic content.&lt;/p&gt;
&lt;p&gt;One of the key benefits of t-strings is their ability to help prevent security vulnerabilities like SQL injection and XSS attacks. They&amp;rsquo;re also valuable in other fields that rely on string templates, such as structured logging.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this video course, you&amp;rsquo;ll understand that:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Python &lt;strong&gt;t-strings&lt;/strong&gt; are a generalization of f-strings, designed to safely handle and process &lt;strong&gt;input values&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;main components&lt;/strong&gt; of a t-string include &lt;strong&gt;static string&lt;/strong&gt; parts and &lt;strong&gt;interpolations&lt;/strong&gt;, which are accessible through the &lt;strong&gt;&lt;code&gt;Template&lt;/code&gt;&lt;/strong&gt; class.&lt;/li&gt;
&lt;li&gt;You process t-strings by iterating over their components, using attributes such as &lt;strong&gt;&lt;code&gt;.strings&lt;/code&gt;&lt;/strong&gt;, &lt;strong&gt;&lt;code&gt;.interpolations&lt;/code&gt;&lt;/strong&gt;, and &lt;strong&gt;&lt;code&gt;.values&lt;/code&gt;&lt;/strong&gt; for safe and customized handling.&lt;/li&gt;
&lt;/ul&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  

</feed>
