-
-
Notifications
You must be signed in to change notification settings - Fork 19.2k
DOC: add whatsnew note about __module__ changes for the public API #62784
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
jorisvandenbossche
merged 1 commit into
pandas-dev:main
from
jorisvandenbossche:set-module-whatsnew
Oct 23, 2025
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -515,6 +515,22 @@ If we had passed ``pd.Int64Dtype()`` or ``"int64[pyarrow]"`` for the dtype in th | |||||
|
|
||||||
| With ``"mode.nan_is_na"`` set to ``False``, ``ser.to_numpy()`` (and ``frame.values`` and ``np.asarray(obj)``) will convert to ``object`` dtype if :class:`NA` entries are present, where before they would coerce to ``NaN``. To retain a float numpy dtype, explicitly pass ``na_value=np.nan`` to :meth:`Series.to_numpy`. | ||||||
|
|
||||||
| The ``__module__`` attribute now points to public modules | ||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||||||
|
|
||||||
| The ``__module__`` attribute on functions and classes in the public API has been | ||||||
| updated to refer to the preferred public module from which to access the object, | ||||||
| rather than the module in which the object happens to be defined (:issue:`55178`). | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| This produces more informative displays in the Python console for classes, e.g., | ||||||
| instead of ``<class 'pandas.core.frame.DataFrame'>`` you now see | ||||||
| ``<class 'pandas.DataFrame'>``, and in interactive tools such as IPython, e.g., | ||||||
| instead of ``<function pandas.io.parsers.readers.read_csv(...)>`` you now see | ||||||
| ``<function pandas.read_csv(...)>``. | ||||||
|
|
||||||
| This may break code that relies on the previous ``__module__`` values (e.g. | ||||||
| doctests inspecting the ``type()`` of a DataFrame object). | ||||||
|
|
||||||
| .. _whatsnew_300.api_breaking.deps: | ||||||
|
|
||||||
| Increased minimum version for Python | ||||||
|
|
||||||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I don't think using "object" here makes sense in referring to "function"
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.
From the "everything in Python in an object", I think this makes sense.
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.
Hadn't heard that statement before. But it makes sense. I'll leave it up to Joris if he wants to change it.
Uh oh!
There was an error while loading. Please reload this page.
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.
Also good with object. This statement also applies to class instances (e.g.
pd.NA).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.
Yeah, I wanted to avoid repeating "function or class".
Will leave it as is then