You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, Pyright correctly detects a type error in the SubElement call. SubElement has this Python signature:
defSubElement(parent, tag, attrib={}, **extra):
The parent parameter has already been assigned, so this should fail. I believe the fact that it doesn't is because it's actually using a C implementation, and the C implementation has this type signature:
Bug report
Bug description:
This code runs fine on Python 3.13.7:
However, Pyright correctly detects a type error in the
SubElementcall.SubElementhas this Python signature:The
parentparameter has already been assigned, so this should fail. I believe the fact that it doesn't is because it's actually using a C implementation, and the C implementation has this type signature:Which does allow specifying
parent="0".So I think the solution is just to add that
/into the Python code.CPython versions tested on:
3.13
Operating systems tested on:
Linux
Linked PRs