<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Debugging on ErrorVault — Developer Error Code Dictionary</title><link>https://errorvault.dev/tags/debugging/</link><description>Recent content in Debugging on ErrorVault — Developer Error Code Dictionary</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sat, 05 Oct 2024 00:00:00 +0000</lastBuildDate><atom:link href="https://errorvault.dev/tags/debugging/feed.xml" rel="self" type="application/rss+xml"/><item><title>Fix IndexError: Index out of range error in Python lists and sequences</title><link>https://errorvault.dev/python/python-indexerror-out-of-bounds/</link><pubDate>Sat, 05 Oct 2024 00:00:00 +0000</pubDate><guid>https://errorvault.dev/python/python-indexerror-out-of-bounds/</guid><description>&lt;h2 id="1-symptoms">1. Symptoms&lt;/h2>
&lt;p>The &lt;code>IndexError: index X is out of bounds for axis Y with size Z&lt;/code> (or simply &lt;code>IndexError: list index out of range&lt;/code>) occurs when attempting to access an element in a sequence (list, tuple, string, or array) using an index outside its valid range. Valid indices for a sequence of length &lt;code>n&lt;/code> are from &lt;code>0&lt;/code> to &lt;code>n-1&lt;/code> (positive) or &lt;code>-1&lt;/code> to &lt;code>-n&lt;/code> (negative).&lt;/p>
&lt;p>Common manifestations:&lt;/p>
&lt;ul>
&lt;li>&lt;code>IndexError: list index out of range&lt;/code> – Most frequent, on lists.&lt;/li>
&lt;li>&lt;code>IndexError: tuple index out of range&lt;/code> – On immutable tuples.&lt;/li>
&lt;li>&lt;code>IndexError: string index out of range&lt;/code> – On strings.&lt;/li>
&lt;li>&lt;code>IndexError: index 5 is out of bounds for axis 0 with size 3&lt;/code> – NumPy arrays, specifying axis.&lt;/li>
&lt;/ul>
&lt;p>Stack traces point to the exact line:&lt;/p></description></item><item><title>Fix TypeError: Resolve type mismatches in Python code and functions</title><link>https://errorvault.dev/python/python-typeerror-type-mismatches/</link><pubDate>Wed, 18 Sep 2024 00:00:00 +0000</pubDate><guid>https://errorvault.dev/python/python-typeerror-type-mismatches/</guid><description>&lt;h2 id="1-symptoms">1. Symptoms&lt;/h2>
&lt;p>TypeError in Python occurs when an operation or function receives an argument of an incompatible type. The error message typically follows the format: &lt;code>TypeError: &amp;lt;operation&amp;gt;(): argument types did not match C types&lt;/code> or &lt;code>TypeError: unsupported operand type(s) for &amp;lt;operator&amp;gt;: '&amp;lt;type1&amp;gt;' and '&amp;lt;type2&amp;gt;'&lt;/code>.&lt;/p>
&lt;p>Common symptoms include:&lt;/p>
&lt;ul>
&lt;li>
&lt;p>Arithmetic operations on non-numeric types:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-fallback" data-lang="fallback">&lt;span style="display:flex;">&lt;span>&amp;gt;&amp;gt;&amp;gt; 5 + &amp;#34;hello&amp;#34;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>TypeError: unsupported operand type(s) for +: &amp;#39;int&amp;#39; and &amp;#39;str&amp;#39;
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;/li>
&lt;li>
&lt;p>Function calls with wrong argument types:&lt;/p></description></item></channel></rss>