[docutils:patches] #216 Fix type annotation for get_default_settings
Günter Milde via Docutils-develop <[email protected]> Fri, 29 May 2026 08:26:52 -0000
| Newsgroups | gmane.text.docutils.devel |
|---|---|
| Message-ID | </p/docutils/patches/216/48dd61815449618b6534e7da13d026c71f1e47c5.patches@docutils.p.sourceforge.net> |
This is a multi-part message in MIME format. --===============6401314275762224405== Content-Type: multipart/related; boundary="===============1737153778300628146==" This is a multi-part message in MIME format. --===============1737153778300628146== Content-Type: multipart/alternative; boundary="===============5748185911307591479==" MIME-Version: 1.0 --===============5748185911307591479== MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit - **status**: open-accepted --> closed-accepted - **Comment**: Fixed in [Docutils 0.23](https://pypi.org/project/docutils/0.23/). Thank you again for report and patch. --- **[patches:#216] Fix type annotation for get\_default\_settings** **Status:** closed-accepted **Group:** None **Created:** Thu Jan 22, 2026 09:04 AM UTC by Dmitry Shachnev **Last Updated:** Sun Jan 25, 2026 02:16 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. --===============5748185911307591479== 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-accepted --> closed-accepted</li> <li><strong>Comment</strong>:</li> </ul> <p>Fixed in <a href="https://pypi.org/project/docutils/0.23/" rel="nofollow">Docutils 0.23</a>.<br/> Thank you again for report and patch.</p> <hr/> <p><strong><a class="alink strikethrough" href="https://sourceforge.net/p/docutils/patches/216/">[patches:#216]</a> Fix type annotation for get_default_settings</strong></p> <p><strong>Status:</strong> closed-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:16 PM UTC<br/> <strong>Owner:</strong> nobody<br/> <strong>Attachments:</strong></p> <ul> <li><a 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> (sourceforge.net) (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> --===============5748185911307591479==-- --===============1737153778300628146==-- --===============6401314275762224405== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============6401314275762224405== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline