-
Notifications
You must be signed in to change notification settings - Fork 85
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
Fix documentation build due to class being name shadowed by a singleton #1378
Conversation
Alternatively we can change the class name to be different. Or maybe there are other tricks. However I find the name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but let's make it _no_default_specified
, so that it's clearly private, to discourage use elsewhere.
In theory this is an API-breaking change for anyone using NoDefaultSpecified
in other packages. In practice I can't find any other uses within ETS, uses outside ETS seem unlikely, and I'm willing to risk the breakage.
We might also consider renaming the class to _NoDefaultSpecified
, or even simply using an instance of object
as the sentinel, but that can be done in a separate PR.
Ah, good point about this being API-breaking. |
On |
Okay. The urgent need is to get the doc build fixed, so that CI isn't blocked. For that, how about we simply change the incorrect |
I will merge this to resolve #1377 and unblock CI for PRs. |
Please could you make the requested name change before merging? |
Ah, sorry; too late. |
Oops, sorry. I thought the name change is related to the new issue. |
Okay; please open the new issue and we'll discuss there. Thanks for the quick fix. |
Opened #1379 |
…)" This reverts commit a68bc50.
* Revert PR #1380, but keep the test in test_readonly.py * Revert "Prevent singleton instance from name shadowing its class (#1378)" This reverts commit a68bc50. * Rename the type, add docstrings for the type and the singleton instance * Fix the doc build * Add tests for NoDefaultSpecified * Add paragraph explaining the intended purpose of NoDefaultSpecified * Remove misleading typing stub for NoDefaultSpecified (which isn't a class) * Fix spurious blank line change
Fix #1377
The singleton instance name is the same as its type name. This is confusing sphinx, and is causing the following error with Sphinx 3.4.1 while building doc:
Checklist
TestsUpdate API reference (docs/source/traits_api_reference
)Update User manual (docs/source/traits_user_manual
)Update type annotation hints intraits-stubs