<div dir="ltr"><div>If you want an example of stubs I think most stubs do import collections and use collections.abc.</div><div><br></div><div>If you want an example of code that throws pyright of:</div><div><br></div><div>from PyQt6.QtCore import QDir<br>QDir().entryInfoList(QDir.Filter.Dirs | QDir.Filter.NoDotAndDotDot)<br><br></div><div>Because one of the overload of `entryInfoList()` uses collections.abc.</div><div><br></div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Thu, May 28, 2026 at 5:48 PM Phil Thompson <<a href="mailto:phil@riverbankcomputing.com">phil@riverbankcomputing.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 28/05/2026 10:20, Mikaël Capelle wrote:<br>
> In many PyQt6 stubs file, abstract collections from `collections.abc` <br>
> are<br>
> used, but the import is `collections` which breaks pyright (see<br>
> <a href="https://github.com/microsoft/pyright/issues/5241" rel="noreferrer" target="_blank">https://github.com/microsoft/pyright/issues/5241</a>), which is one of the <br>
> most<br>
> commonly used type checker.<br>
> <br>
> An easy fix would to import `collections.abc` instead of simply<br>
> `collections` (or both if both are needed) in the stubs file.<br>
> <br>
> Holt59<br>
<br>
Can you point me to a specific example?<br>
<br>
Phil<br>
</blockquote></div>