Skip to content

Conversation

@rustamali9183
Copy link
Contributor

This PR fixes the documentation mismatch reported in issue #63144

The actual function signature accepts None as a valid value (copy: bool | lib.NoDefault) and the internal implementation supports None to indicate default lazy-copy behavior.

This PR updates the docstring to:

copy : bool or None, default None 

No code changes are made, only documentation updates.

Copy link
Member

@rhshadrach rhshadrach left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! I believe the option of no_default is just to allow the deprecation. I do not think there are any issues with the docs.

Whether to copy the data or not.
- True : always return a new object.
- False : try to avoid copying and return a view if possible.
Copy link
Member

Choose a reason for hiding this comment

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

With copy-on-write now the default, this seems misleading to me.

- True : always return a new object.
- False : try to avoid copying and return a view if possible.
- None : use the default lazy-copy behavior (recommended).
Copy link
Member

Choose a reason for hiding this comment

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

The type-hint is for no_default, not None. Also the wording here suggests to me that not specifying None does not use the default lazy-copy behavior.

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.

[DOC] Incorrect typing in astype for the copy argument

2 participants