Skip to content

gh-91484: Allow memoryview cast for F-contiguous#137803

Merged
serhiy-storchaka merged 7 commits into
python:mainfrom
jamie2779:gh-91484
Jul 24, 2026
Merged

gh-91484: Allow memoryview cast for F-contiguous#137803
serhiy-storchaka merged 7 commits into
python:mainfrom
jamie2779:gh-91484

Conversation

@jamie2779

@jamie2779 jamie2779 commented Aug 15, 2025

Copy link
Copy Markdown
Contributor

Allow N-D to 1-D memoryview cast for F-contiguous

@python-cla-bot

python-cla-bot Bot commented Aug 15, 2025

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

@bedevere-app

bedevere-app Bot commented Aug 15, 2025

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@StanFromIreland StanFromIreland left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This change needs a NEWS entry, you can do it via the web interface (comment above) or with the blurb tool locally. You also have some trailing whitespace.

@jamie2779

Copy link
Copy Markdown
Contributor Author

@corona10 Please check my Pull Request

@jamie2779

Copy link
Copy Markdown
Contributor Author

@StanFromIreland thank you! I added NEWS entry.

@corona10 corona10 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please check lint status, looks like there is empty space in some line.

@jamie2779

Copy link
Copy Markdown
Contributor Author

Ok, I removed the trailing whitespace.

@serhiy-storchaka
serhiy-storchaka self-requested a review August 15, 2025 10:06
@jamie2779
jamie2779 requested a review from corona10 August 21, 2025 05:43
@github-actions

Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Apr 28, 2026
@github-project-automation github-project-automation Bot moved this to Todo in Sprint Apr 28, 2026

@serhiy-storchaka serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks fine. I added some minor suggestions, and please update Doc/library/stdtypes.rst which says "Supported casts are 1D -> C-:term:contiguous and C-contiguous -> 1D." Mention that an F-contiguous can also be cast to 1D. Add versionchanged:: next and a What's New entry.

I just submitted a complementary PR #153663. They can be merged in arbitrary order, but the latter will need to resolve conflict in What's New.

Comment thread Objects/memoryobject.c Outdated
Comment thread Objects/memoryobject.c Outdated
Comment thread Misc/NEWS.d/next/Core_and_Builtins/2025-08-15-06-28-45.gh-issue-91484.huCgHt.rst Outdated
@github-actions github-actions Bot removed the stale Stale PR or inactive for long period of time. label Jul 15, 2026
@jamie2779
jamie2779 requested a review from AA-Turner as a code owner July 24, 2026 12:23
@read-the-docs-community

read-the-docs-community Bot commented Jul 24, 2026

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33743354 | 📁 Comparing d215db1 against main (b1e530e)

  🔍 Preview build  

3 files changed
± library/stdtypes.html
± whatsnew/3.16.html
± whatsnew/changelog.html

@jamie2779

Copy link
Copy Markdown
Contributor Author

Thanks for the review! I applied the suggestions and updated the docs, NEWS, and What's New entry. Please let me know if I missed anything.

@serhiy-storchaka serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. 👍

Thank you for your contribution!

Comment thread Lib/test/test_buffer.py Outdated
@github-project-automation github-project-automation Bot moved this from Todo to In Progress in Sprint Jul 24, 2026
@serhiy-storchaka
serhiy-storchaka enabled auto-merge (squash) July 24, 2026 12:46

@serhiy-storchaka serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thanks! All review points addressed.

Note for whoever merges second (this or #153663): there will be a trivial What's New conflict in Doc/whatsnew/3.16.rst since both add to "Other language changes".

@serhiy-storchaka
serhiy-storchaka merged commit a400767 into python:main Jul 24, 2026
53 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Sprint Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants