[docutils:patches] #216 Fix type annotation for get_default_settings

Dmitry Shachnev via Docutils-develop <[email protected]> Thu, 22 Jan 2026 09:04:35 -0000
Newsgroups gmane.text.docutils.devel
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--===============6578547833849683537==
Content-Type: multipart/related; boundary="===============4996758642821711790=="

This is a multi-part message in MIME format.
--===============4996758642821711790==
Content-Type: multipart/alternative; boundary="===============9000311334798709231=="
MIME-Version: 1.0

--===============9000311334798709231==
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit




---

**[patches:#216] Fix type annotation for get_default_settings**

**Status:** open
**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.
--===============9000311334798709231==
MIME-Version: 1.0
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: 7bit

<div class="markdown_content"><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<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>
--===============9000311334798709231==--

--===============4996758642821711790==--


--===============6578547833849683537==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============6578547833849683537==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline