Thank you very much for bringing this to our attention. It turns out that ellipsis is actually the built-in type for Ellipsis. Indeed, you may find that:
Hi @jeremi.dodinh,
thanks for your answer, which is interesting but appears incorrect to me. Yes, the type of Ellipsis is shown as ellipsis, but that does not mean that ellipsis is a shadow-able built-in. Actually, ellipsis is not defined on a Python (3.12) prompt. In addition, the type of Ellipsis is accessible via types.EllipsisType, which it seems was introduced in Python 3.10, and which would not have been necessary to introduce if something as simple as ellipsis existed (right?). Compare https://github.com/python/cpython/issues/85976.
>>> ellipsis
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'ellipsis' is not defined. Did you mean: 'Ellipsis'?
>>> import types; types.EllipsisType
<class 'ellipsis'>
By the way, Sonar does not annotate Ellipsis as a built-in, and that is a false-negative. I think someone just made an honest mistake by adding ellipsis to the list of built-ins instead ofEllipsis. In line with this, ruff (A003) flags Ellipsis but not ellipsis.
Thanks for the clarification, and I’m sorry for the incorrect response. I will be looking into this today, and I have created a ticket for that purpose.