Skip to content

GH851 Change use of NoDefault to make it more private #1262

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 25, 2025

Conversation

loicdiridollou
Copy link
Member

It turns out you can't actually make it fully private with _ at the start of the name as it will raise a lint with PYI (it does not see it used in the file itself although it is used outside the file).

pandas-stubs/_libs/lib.pyi:17:1: PYI047 Private TypeAlias `_NoDefaultDoNotUse` is never used
   |
16 | no_default: Final = _NoDefault.no_default
17 | _NoDefaultDoNotUse: TypeAlias = Literal[_NoDefault.no_default]
   | ^^^^^^^^^^^^^^^^^^ PYI047
18 |
19 | def infer_dtype(value: object, skipna: bool = ...) -> str: ...
   |

Found 1 error. 

@loicdiridollou loicdiridollou requested a review from Dr-Irv June 24, 2025 20:58
Copy link
Collaborator

@Dr-Irv Dr-Irv left a comment

Choose a reason for hiding this comment

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

Let's make it private and just put a # noqa: PYI047 on that line.

Copy link
Collaborator

@Dr-Irv Dr-Irv left a comment

Choose a reason for hiding this comment

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

@Dr-Irv Dr-Irv merged commit 9c49879 into pandas-dev:main Jun 25, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change use of NoDefault to be private and maybe indicate it shouldn't be passed
2 participants