Skip to content

Conversation

fleming79
Copy link
Contributor

Recently Pylance (Pyright) started producing Any as the type hint for HasTraits objects since Pylance v 2025.2.102 & Pyright v 1.1.395. This may be related to the first dot point in the Pyright release notes here: https://github.com/microsoft/pyright/releases/tag/1.1.395.

Before

image

After

image

Reference: https://typing.python.org/en/latest/spec/constructors.html#consistency-of-new-and-init

cls = args[0]
args = args[1:]

def __new__(cls, /, *args: t.Any, **kwargs: t.Any) -> Self:
Copy link
Contributor Author

@fleming79 fleming79 Mar 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@minrk minrk merged commit 945250c into ipython:main Apr 11, 2025
30 of 31 checks passed
@minrk
Copy link
Member

minrk commented Apr 11, 2025

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants