[docutils:patches] #216 Fix type annotation for get_default_settings
Günter Milde via Docutils-develop <[email protected]> Sun, 25 Jan 2026 14:16:10 -0000
| Newsgroups | gmane.text.docutils.devel |
|---|---|
| Message-ID | </p/docutils/patches/216/2d4222e55351efe54a2811785988ce94009adecd.patches@docutils.p.sourceforge.net> |
This is a multi-part message in MIME format. --===============2058873780339804040== Content-Type: multipart/related; boundary="===============6280374260339360791==" This is a multi-part message in MIME format. --===============6280374260339360791== Content-Type: multipart/alternative; boundary="===============4470529623967034250==" MIME-Version: 1.0 --===============4470529623967034250== MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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:** Sun Jan 25, 2026 02:15 PM 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. --===============4470529623967034250== MIME-Version: 1.0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: 7bit <div class="markdown_content"><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> Sun Jan 25, 2026 02:15 PM 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> --===============4470529623967034250==-- --===============6280374260339360791==-- --===============2058873780339804040== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============2058873780339804040== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline