<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Static Analysis on Nalar</title>
    <link>https://nalar.dev/tags/static-analysis/</link>
    <description>Recent content in Static Analysis on Nalar</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Wed, 09 Sep 2026 00:00:00 +0700</lastBuildDate>
    <atom:link href="https://nalar.dev/tags/static-analysis/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Compare Python Syntax Trees with ast.compare</title>
      <link>https://nalar.dev/compare-python-syntax-trees-with-ast-compare/</link>
      <pubDate>Wed, 09 Sep 2026 00:00:00 +0700</pubDate>
      <guid>https://nalar.dev/compare-python-syntax-trees-with-ast-compare/</guid>
      <description>&lt;p&gt;Tools that rewrite Python source often need to answer a deceptively simple question: did this transformation preserve the syntax tree that matters?&lt;/p&gt;&#xA;&lt;p&gt;Before Python 3.14, a common solution was to serialize both trees with &lt;code&gt;ast.dump()&lt;/code&gt; and compare the resulting strings. That works in small tests, but it turns a structural question into a formatting contract. Python 3.14 adds &lt;code&gt;ast.compare()&lt;/code&gt;, a recursive AST comparison helper that expresses the intent directly.&lt;/p&gt;&#xA;&lt;p&gt;This is especially useful for formatters, codemods, linters, source generators, refactoring tools, and tests that round-trip Python code.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
