<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Sour durian</title>
    <description>The latest articles on DEV Community by Sour durian (@duriantaco).</description>
    <link>https://dev.to/duriantaco</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2757090%2Fcf7b3e60-5d34-4a60-9a8b-1e954aed1128.png</url>
      <title>DEV Community: Sour durian</title>
      <link>https://dev.to/duriantaco</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/duriantaco"/>
    <language>en</language>
    <item>
      <title>Python Dead Code: I Scanned Flask, FastAPI, and 7 Other Popular Repos — Here's What I Found</title>
      <dc:creator>Sour durian</dc:creator>
      <pubDate>Tue, 10 Mar 2026 14:06:37 +0000</pubDate>
      <link>https://dev.to/duriantaco/python-dead-code-i-scanned-flask-fastapi-and-7-other-popular-repos-heres-what-i-found-5c1c</link>
      <guid>https://dev.to/duriantaco/python-dead-code-i-scanned-flask-fastapi-and-7-other-popular-repos-heres-what-i-found-5c1c</guid>
      <description>&lt;p&gt;Dead code is the tech debt nobody talks about. Unused functions, orphaned imports, abandoned classes — they get maintained, reviewed in PRs, and tested in CI. And they do absolutely nothing.&lt;/p&gt;

&lt;p&gt;I wanted to answer two questions:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;How much dead code exists&lt;/strong&gt; in the most popular Python projects on GitHub?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Can static analysis tools reliably detect it&lt;/strong&gt; without drowning you in false positives?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So I ran dead code detection on &lt;strong&gt;9 of the most popular Python repositories&lt;/strong&gt; (350k+ combined stars) and &lt;strong&gt;manually verified every single finding&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The 9 Python Repos I Tested
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Repository&lt;/th&gt;
&lt;th&gt;Stars&lt;/th&gt;
&lt;th&gt;Why it's a good stress test&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://github.com/fastapi/fastapi" rel="noopener noreferrer"&gt;fastapi/fastapi&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;82k&lt;/td&gt;
&lt;td&gt;100+ Pydantic model fields for OpenAPI specs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://github.com/pallets/flask" rel="noopener noreferrer"&gt;pallets/flask&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;69k&lt;/td&gt;
&lt;td&gt;Jinja2 template globals, Werkzeug protocol methods&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://github.com/psf/requests" rel="noopener noreferrer"&gt;psf/requests&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;53k&lt;/td&gt;
&lt;td&gt;Heavy &lt;code&gt;__init__.py&lt;/code&gt; re-exports&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://github.com/Textualize/rich" rel="noopener noreferrer"&gt;Textualize/rich&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;51k&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;__rich_console__&lt;/code&gt; protocol, metaclasses&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://github.com/tqdm/tqdm" rel="noopener noreferrer"&gt;tqdm/tqdm&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;30k&lt;/td&gt;
&lt;td&gt;Keras/Dask callbacks, pandas monkey-patching&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://github.com/pydantic/pydantic" rel="noopener noreferrer"&gt;pydantic/pydantic&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;23k&lt;/td&gt;
&lt;td&gt;Mypy plugin hooks, &lt;code&gt;__getattr__&lt;/code&gt; dynamic config&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://github.com/pallets/click" rel="noopener noreferrer"&gt;pallets/click&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;17k&lt;/td&gt;
&lt;td&gt;IO protocol methods, nonlocal closures&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://github.com/encode/httpx" rel="noopener noreferrer"&gt;encode/httpx&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;14k&lt;/td&gt;
&lt;td&gt;Transport/auth protocol methods — zero dead code&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://github.com/encode/starlette" rel="noopener noreferrer"&gt;encode/starlette&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;10k&lt;/td&gt;
&lt;td&gt;ASGI interface params, polymorphic dispatch&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Every finding was &lt;strong&gt;manually verified&lt;/strong&gt; against the source code. No automated labelling. No cherry-picking.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Much Dead Code Did I Find?
&lt;/h2&gt;

&lt;p&gt;Across all 9 repos: &lt;strong&gt;52 genuinely dead items&lt;/strong&gt; — unused functions, classes, imports, and variables.&lt;/p&gt;

&lt;p&gt;But here's the interesting part: &lt;strong&gt;the false positive problem is way worse than the dead code itself.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I compared two Python dead code detection tools — &lt;a href="https://github.com/jendrikseipp/vulture" rel="noopener noreferrer"&gt;Vulture&lt;/a&gt; (the most popular Python dead code finder) and &lt;a href="https://github.com/duriantaco/skylos" rel="noopener noreferrer"&gt;Skylos&lt;/a&gt; (a framework-aware tool I built to reduce false positives).&lt;/p&gt;

&lt;h3&gt;
  
  
  Python Dead Code Detection: Skylos vs Vulture
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Repository&lt;/th&gt;
&lt;th&gt;Dead Items&lt;/th&gt;
&lt;th&gt;Skylos Found&lt;/th&gt;
&lt;th&gt;Skylos FP&lt;/th&gt;
&lt;th&gt;Vulture Found&lt;/th&gt;
&lt;th&gt;Vulture FP&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;psf/requests&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;6&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;35&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;58&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;pallets/click&lt;/td&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;7&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;encode/starlette&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Textualize/rich&lt;/td&gt;
&lt;td&gt;13&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;13&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;14&lt;/td&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;encode/httpx&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;59&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;pallets/flask&lt;/td&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;7&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;12&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;260&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;pydantic/pydantic&lt;/td&gt;
&lt;td&gt;11&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;11&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;93&lt;/td&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;td&gt;112&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;fastapi/fastapi&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;6&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;30&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;102&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;tqdm/tqdm&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;18&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;37&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Total&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;52&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;51&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;220&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;44&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;644&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Summary
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Metric&lt;/th&gt;
&lt;th&gt;Skylos&lt;/th&gt;
&lt;th&gt;Vulture&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Recall&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;98.1%&lt;/strong&gt; (51/52)&lt;/td&gt;
&lt;td&gt;84.6% (44/52)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;False Positives&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;220&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;644&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Dead items found&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;51&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;44&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Skylos finds 7 more dead items with &lt;strong&gt;3x fewer false positives&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Python Dead Code Detection Produces So Many False Positives
&lt;/h2&gt;

&lt;p&gt;The biggest source of noise? &lt;strong&gt;Python framework magic.&lt;/strong&gt; Django, Flask, FastAPI, and pytest all use patterns that look like dead code to static analysis but are very much alive at runtime.&lt;/p&gt;

&lt;h3&gt;
  
  
  Flask: 260 False Positives from Vulture
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Vulture flags this as unused — but Jinja2 calls it at render time
&lt;/span&gt;&lt;span class="nd"&gt;@app.template_global&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;format_date&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dt&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;dt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;strftime&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;%Y-%m-%d&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Vulture reported &lt;strong&gt;260 false positives&lt;/strong&gt; on Flask. Most were Jinja2 template globals and Werkzeug protocol methods that Flask calls internally. Skylos reported 12 because it recognizes Flask-specific patterns.&lt;/p&gt;

&lt;h3&gt;
  
  
  FastAPI: Pydantic Model Fields Aren't Unused Variables
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ValidationError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;BaseModel&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;detail&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;
    &lt;span class="n"&gt;status_code&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;422&lt;/span&gt;  &lt;span class="c1"&gt;# Vulture: "unused variable"
&lt;/span&gt;    &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;dict&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;  &lt;span class="c1"&gt;# Vulture: "unused variable"
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pydantic &lt;code&gt;BaseModel&lt;/code&gt; fields define your API schema. They're serialized, validated, and documented by OpenAPI — but never "called" in the traditional sense. Vulture flagged &lt;strong&gt;102&lt;/strong&gt; of these in FastAPI. Skylos flagged 30.&lt;/p&gt;

&lt;h3&gt;
  
  
  Where Skylos Still Gets It Wrong (Honestly)
&lt;/h3&gt;

&lt;p&gt;No Python dead code tool is perfect. Some patterns still fool Skylos:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Repo&lt;/th&gt;
&lt;th&gt;Skylos FP&lt;/th&gt;
&lt;th&gt;Vulture FP&lt;/th&gt;
&lt;th&gt;Why Skylos loses&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;click&lt;/td&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;6&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;IO protocol methods on &lt;code&gt;io.RawIOBase&lt;/code&gt; subclasses&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;starlette&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;2&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Instance method calls not resolved to class definitions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;rich&lt;/td&gt;
&lt;td&gt;14&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;8&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Sentinel vars checked via &lt;code&gt;f_locals.get("name")&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;When code uses very dynamic Python patterns like frame inspection (&lt;code&gt;f_locals&lt;/code&gt;), both tools struggle. Vulture actually does better on &lt;code&gt;rich&lt;/code&gt; because its more conservative analysis happens to avoid those specific cases.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Python Repo with Zero Dead Code
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;httpx&lt;/strong&gt; had zero dead items. Every function, class, and import is used. It's one of the cleanest Python codebases I've seen.&lt;/p&gt;

&lt;p&gt;But Vulture still reported &lt;strong&gt;59 false positives&lt;/strong&gt; on it — mostly transport and auth protocol methods that implement interfaces without explicit callers in the same codebase. Skylos reported 6.&lt;/p&gt;

&lt;p&gt;A tool that reports 59 issues when there are 0 real problems trains developers to ignore its output entirely.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Dead Code I Actually Found in Popular Python Projects
&lt;/h2&gt;

&lt;p&gt;Some highlights from genuinely dead code:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;requests&lt;/strong&gt;: 6 dead items including unused re-exports in &lt;code&gt;__init__.py&lt;/code&gt; that survived years of refactoring&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;rich&lt;/strong&gt;: 13 dead items — unused utility functions and classes that were replaced but never removed&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;pydantic&lt;/strong&gt;: 11 dead items including leftover mypy plugin hooks from API changes&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;flask&lt;/strong&gt;: 7 dead items — old extension hooks that nothing calls anymore&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of these are security vulnerabilities. But they add up: dead code gets reviewed in PRs, confuses new contributors, and creates false dependencies that make refactoring harder.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Find Dead Code in Your Own Python Project
&lt;/h2&gt;

&lt;p&gt;All benchmark scripts and ground truth data are open source:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/duriantaco/skylos-demo
&lt;span class="nb"&gt;cd &lt;/span&gt;skylos-demo

&lt;span class="c"&gt;# Run any individual benchmark&lt;/span&gt;
&lt;span class="nb"&gt;cd &lt;/span&gt;real_life_examples/flask
python3 ../benchmark_flask.py

&lt;span class="c"&gt;# Or install and try on your own project&lt;/span&gt;
pip &lt;span class="nb"&gt;install &lt;/span&gt;skylos
skylos your-project/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Skylos also does security scanning (taint analysis, hardcoded secrets, SQL injection) and has an &lt;a href="https://github.com/duriantaco/skylos#remediation-agent" rel="noopener noreferrer"&gt;AI remediation agent&lt;/a&gt; that can auto-fix issues and open PRs.&lt;/p&gt;

&lt;p&gt;Full methodology, ground truth lists, and per-repo breakdowns: &lt;a href="https://github.com/duriantaco/skylos-demo" rel="noopener noreferrer"&gt;skylos-demo&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Takeaways
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Dead code exists everywhere&lt;/strong&gt; — even in the most popular, well-maintained Python projects&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;False positives are the real problem&lt;/strong&gt; — a tool that reports 644 issues when only 52 are real trains you to ignore static analysis entirely&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Framework awareness matters for Python&lt;/strong&gt; — Django views, FastAPI endpoints, Pydantic fields, pytest fixtures — if your dead code tool doesn't understand Python frameworks, most of its output is noise&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Zero dead code is achievable&lt;/strong&gt; — httpx proves it. Clean Python codebases exist.&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;&lt;em&gt;What does your project's dead code situation look like? Try running &lt;code&gt;pip install skylos &amp;amp;&amp;amp; skylos .&lt;/code&gt; and let me know in the comments.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>security</category>
      <category>opensource</category>
      <category>codequality</category>
    </item>
    <item>
      <title>Ostrich algorithm python package</title>
      <dc:creator>Sour durian</dc:creator>
      <pubDate>Fri, 24 Jan 2025 08:05:01 +0000</pubDate>
      <link>https://dev.to/duriantaco/ostrich-algorithm-python-package-3f87</link>
      <guid>https://dev.to/duriantaco/ostrich-algorithm-python-package-3f87</guid>
      <description>&lt;p&gt;Was taking a break from the serious programming stuff, so I created this python package. &lt;/p&gt;

&lt;p&gt;Here goes! &lt;/p&gt;

&lt;p&gt;The Ostrich Algorithm is a term in programming where developers deliberately ignore certain problems in their code (like an ostrich "burying its head in the sand"). While it sounds like a joke, it's actually a legitimate strategy when:&lt;br&gt;
The problem is super unlikely to occur (or at least we hope so)&lt;br&gt;
Fixing it would cost more than ignoring it&lt;br&gt;
You're dealing with legacy code that works (don't touch it ever!)&lt;br&gt;
Your deadline was yesterday&lt;br&gt;
So ... I created a package that does just that! Except that mine is more of a joke. To use it,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from ostrich import ostrich, Priority

@ostrich(Priority.HIGH, "PERF-123", lines={
    8: "This query makes the DB cry",})
def calculate_user_metrics():
    query = "SELECT * FROM users WHERE..."  
    for metric in all_metrics:             
        results.append(calculate_metric(user, metric))
    return results

`# The output will look like:
# [OSTRICH HIGH][PERF-123] watching from line 3
# Marked lines in this function:
# Line 15 -&amp;gt; This query makes the DB cry
#     query = "SELECT * FROM users WHERE..."`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It will watch from whichever line has the ostrich decorator. And it will highlight that part so that you can just ignore it (or prioritise it).  &lt;/p&gt;

&lt;p&gt;Any comments/hate/feedback/criticism welcomed. &lt;/p&gt;

&lt;p&gt;Link to the github: [(&lt;a href="https://github.com/duriantaco/ostrich)" rel="noopener noreferrer"&gt;https://github.com/duriantaco/ostrich)&lt;/a&gt;]&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
