[docutils:patches] #216 Fix type annotation for get_default_settings
Günter Milde via Docutils-develop <[email protected]> Sun, 25 Jan 2026 14:15:44 -0000
| Newsgroups | gmane.text.docutils.devel |
|---|---|
| Message-ID | </p/docutils/patches/216/85a929be3fbb293596431b50838ec68ccf8e536a.patches@docutils.p.sourceforge.net> |
This is a multi-part message in MIME format. --===============0398452521210395277== Content-Type: multipart/related; boundary="===============0524109236708326626==" This is a multi-part message in MIME format. --===============0524109236708326626== Content-Type: multipart/alternative; boundary="===============8654371196727100754==" MIME-Version: 1.0 --===============8654371196727100754== MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit - **status**: open --> open-accepted - **Comment**: Applied in [r10294]. Thank you for the patch. --- **[patches:#216] Fix type annotation for get_default_settings** **Status:** open-accepted **Group:** None **Created:** Thu Jan 22, 2026 09:04 AM UTC by Dmitry Shachnev **Last Updated:** Thu Jan 22, 2026 09:04 AM UTC **Owner:** nobody **Attachments:** - [0001-Fix-type-annotation-for-get_default_settings.patch](https://sourceforge.net/p/docutils/patches/216/attachment/0001-Fix-type-annotation-for-get_default_settings.patch) (966 Bytes; text/x-patch) It accepts classes themselves, not instances of those classes. This fixes error from mypy that I have for code that calls `get_default_settings(Writer)`. ``` error: Argument 1 to "get_default_settings" has incompatible type "type[Writer]"; expected "SettingsSpec" [arg-type] ``` --- Sent from sourceforge.net because [email protected] is subscribed to https://sourceforge.net/p/docutils/patches/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/docutils/admin/patches/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. --===============8654371196727100754== MIME-Version: 1.0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: 7bit <div class="markdown_content"><ul> <li><strong>status</strong>: open --> open-accepted</li> <li><strong>Comment</strong>:</li> </ul> <p>Applied in <a class="alink" href="https://sourceforge.net/p/docutils/code/10294/">[r10294]</a>. <br/> Thank you for the patch.</p> <hr/> <p><strong><a class="alink" href="https://sourceforge.net/p/docutils/patches/216/">[patches:#216]</a> Fix type annotation for get_default_settings</strong></p> <p><strong>Status:</strong> open-accepted<br/> <strong>Group:</strong> None<br/> <strong>Created:</strong> Thu Jan 22, 2026 09:04 AM UTC by Dmitry Shachnev<br/> <strong>Last Updated:</strong> Thu Jan 22, 2026 09:04 AM UTC<br/> <strong>Owner:</strong> nobody<br/> <strong>Attachments:</strong></p> <ul> <li><a class="" href="https://sourceforge.net/p/docutils/patches/216/attachment/0001-Fix-type-annotation-for-get_default_settings.patch">0001-Fix-type-annotation-for-get_default_settings.patch</a> (966 Bytes; text/x-patch)</li> </ul> <p>It accepts classes themselves, not instances of those classes.</p> <p>This fixes error from mypy that I have for code that calls <code>get_default_settings(Writer)</code>.</p> <div class="codehilite"><pre><span></span><code><span class="nl">error</span><span class="p">:</span><span class="w"> </span><span class="n">Argument</span><span class="w"> </span><span class="mi">1</span><span class="w"> </span><span class="k">to</span><span class="w"> </span><span class="ss">"get_default_settings"</span><span class="w"> </span><span class="n">has</span><span class="w"> </span><span class="n">incompatible</span><span class="w"> </span><span class="n">type</span><span class="w"> </span><span class="ss">"type[Writer]"</span><span class="p">;</span><span class="w"> </span><span class="n">expected</span><span class="w"> </span><span class="ss">"SettingsSpec"</span><span class="w"> </span><span class="o">[</span><span class="n">arg-type</span><span class="o">]</span> </code></pre></div> <hr/> <p>Sent from sourceforge.net because [email protected] is subscribed to <a href="https://sourceforge.net/p/docutils/patches/">https://sourceforge.net/p/docutils/patches/</a></p> <p>To unsubscribe from further messages, a project admin can change settings at <a href="https://sourceforge.net/p/docutils/admin/patches/options.">https://sourceforge.net/p/docutils/admin/patches/options.</a> Or, if this is a mailing list, you can unsubscribe from the mailing list.</p></div> --===============8654371196727100754==-- --===============0524109236708326626==-- --===============0398452521210395277== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============0398452521210395277== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline