René's URL Explorer Experiment


Title: Typing for multi-dimensional arrays · Issue #513 · python/typing · GitHub

Open Graph Title: Typing for multi-dimensional arrays · Issue #513 · python/typing

X Title: Typing for multi-dimensional arrays · Issue #513 · python/typing

Description: I'd like to open a discussion about typing for multi-dimensional arrays in general, and more specifically for NumPy. We have already been discussing this over in the NumPy issue tracker (numpy/numpy#7370) and recently opened a new reposi...

Open Graph Description: I'd like to open a discussion about typing for multi-dimensional arrays in general, and more specifically for NumPy. We have already been discussing this over in the NumPy issue tracker (numpy/nump...

X Description: I'd like to open a discussion about typing for multi-dimensional arrays in general, and more specifically for NumPy. We have already been discussing this over in the NumPy issue tracker (numpy/...

Opengraph URL: https://github.com/python/typing/issues/513

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Typing for multi-dimensional arrays","articleBody":"I'd like to open a discussion about typing for multi-dimensional arrays in general, and more specifically for NumPy. We have already been discussing this over in the NumPy issue tracker (https://github.com/numpy/numpy/issues/7370) and recently opened a new repository to start writing type stubs (https://github.com/numpy/numpy_stubs).\r\n\r\nTo help guide discussion, I wrote a document outlining [ideas for array shape typing](https://docs.google.com/document/d/1vpMse4c6DrWH5rq2tQSx3qwP_m_0lyn-Ij4WHqQqRHY/edit#).\r\n\r\nTo summarize:\r\n- We would like to be able to type-check both data types (e.g., `float64`) and shapes (e.g., a 3x4 array) for multi-dimensional arrays.\r\n- There are many uses cases where support for checks using dimension identity would be valuable, e.g., to indicate that a function transforms an array with shape `(N, M)` to shape `(N,)` for arbitrary integers `N` and `M`. These dimension variables look very similar to `TypeVar`, if `TypeVar` supported integers as types.\r\n- A notion of \"zero or more additional dimensions\" would also be quite valuable, and is a core part of the type for many NumPy operations (generalized ufuncs). This might be naturally written with Ellipsis, e.g., `(...., N)` for an array with a last dimension of length `N` and any number of proceeding dimensions. There are particular rules (broadcasting) that should be enforced for matching multiple arguments with variable numbers of dimensions.\r\n\r\nThis will likely require some new typing features (as well as type-checker support). Notably:\r\n- Support for literal values (https://github.com/python/typing/issues/478), so we can type check operations like `array.sum(axis=0)`.\r\n- Variadic generics (https://github.com/python/typing/issues/193), we can write types like `NDArray[N]` and `NDArray[N, M]`.\r\n- Some sort of support for dimension identity in shapes (e.g., integer types, or `DimensionVar` as described in my doc).\r\n- Standard syntax for writing array dtype/shape annotations: what should these look like?","author":{"url":"https://github.com/shoyer","@type":"Person","name":"shoyer"},"datePublished":"2017-12-07T22:48:04Z","url":"https://github.com/python/typing/issues/513"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:abfa410e-a8d6-1251-ee41-555ecdc65f94
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id83A6:1F3799:2BBD108:398EAFB:6B0016BC
html-safe-noncec9e89905fb27d42dce1746e83d5e1409e0f44d949206fb250cd3ec913375fd02
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4M0E2OjFGMzc5OToyQkJEMTA4OjM5OEVBRkI6NkIwMDE2QkMiLCJ2aXNpdG9yX2lkIjoiMzA1MTcxMDQ5NzY3MDgyOTc1NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac3d36dbd85a5f3fa5ccd4b03437438ad083c6bb7893e80d38ef4ea51fb1c90dde
hovercard-subject-tagissue:280306982
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/typing/513/issue_layout
twitter:imagehttps://opengraph.githubassets.com/4bfe4754ec1c83bd1f63bbbc5d3f7b0f1da4df400789e05b353a38656ff0a9be/python/typing/issues/513
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/4bfe4754ec1c83bd1f63bbbc5d3f7b0f1da4df400789e05b353a38656ff0a9be/python/typing/issues/513
og:image:altI'd like to open a discussion about typing for multi-dimensional arrays in general, and more specifically for NumPy. We have already been discussing this over in the NumPy issue tracker (numpy/nump...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameshoyer
hostnamegithub.com
expected-hostnamegithub.com
Nonea2dd2291b1b13cc9c06f27ec92fa3dbaf34116fc24c9347b8539db61884c59f4
turbo-cache-controlno-preview
go-importgithub.com/python/typing git https://github.com/python/typing.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id24604008
octolytics-dimension-repository_nwopython/typing
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id24604008
octolytics-dimension-repository_network_root_nwopython/typing
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release70121d4e855ee0bb7b75cf15d061d91f8863c0f8
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/typing/issues/513#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Ftyping%2Fissues%2F513
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Ftyping%2Fissues%2F513
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Ftyping
Reloadhttps://github.com/python/typing/issues/513
Reloadhttps://github.com/python/typing/issues/513
Reloadhttps://github.com/python/typing/issues/513
pythonhttps://github.com/python
typinghttps://github.com/python/typing
Codehttps://github.com/python/typing
Issues206 (206)https://github.com/python/typing/issues
Pull requests27 (27)https://github.com/python/typing/pulls
Discussionshttps://github.com/python/typing/discussions
Actionshttps://github.com/python/typing/actions
Security and qualityhttps://github.com/python/typing/security
Insightshttps://github.com/python/typing/insights
https://github.com/python/typing
New issuehttps://github.com/login?return_to=https://github.com/python/typing/issues/513
New issuehttps://github.com/login?return_to=https://github.com/python/typing/issues/513
Typing for multi-dimensional arrayshttps://github.com/python/typing/issues/513#top
topic: featureDiscussions about new features for Python's type annotationshttps://github.com/python/typing/issues?q=state%3Aopen%20label%3A%22topic%3A%20feature%22
https://github.com/shoyer
shoyerhttps://github.com/shoyer
on Dec 7, 2017https://github.com/python/typing/issues/513#issue-280306982
numpy/numpy#7370https://github.com/numpy/numpy/issues/7370
https://github.com/numpy/numpy_stubshttps://github.com/numpy/numpy_stubs
ideas for array shape typinghttps://docs.google.com/document/d/1vpMse4c6DrWH5rq2tQSx3qwP_m_0lyn-Ij4WHqQqRHY/edit
Check that literal strings/int/float belong to /is excluded from a set/range of values #478https://github.com/python/typing/issues/478
Allow variadic generics #193https://github.com/python/typing/issues/193
https://github.com/ilevkivskyi
ilevkivskyihttps://github.com/ilevkivskyi
on Dec 7, 2017https://github.com/python/typing/issues/513#issuecomment-350125229
python/mypy#3345https://github.com/python/mypy/issues/3345
@JukkaLhttps://github.com/JukkaL
https://github.com/shoyer
shoyerhttps://github.com/shoyer
on Dec 9, 2017https://github.com/python/typing/issues/513#issuecomment-350425048
https://github.com/shoyer
shoyerhttps://github.com/shoyer
on Dec 10, 2017https://github.com/python/typing/issues/513#issuecomment-350517548
#516https://github.com/python/typing/issues/516
https://github.com/ilevkivskyi
ilevkivskyihttps://github.com/ilevkivskyi
on Jan 9, 2019https://github.com/python/typing/issues/513#issuecomment-452659144
https://github.com/ilevkivskyi
ilevkivskyihttps://github.com/ilevkivskyi
on Apr 28, 2019https://github.com/python/typing/issues/513#issuecomment-487331095
Here they arehttps://paper.dropbox.com/doc/Type-system-improvements--AcGspbDyv7nsrVeZOw~L2i_QAg-HHOkniMG9WcCgS0LzXZAe
https://github.com/vsiles
vsileshttps://github.com/vsiles
on May 7, 2019https://github.com/python/typing/issues/513#issuecomment-490137120
https://stackoverflow.com/questions/56022497/numpy-pytorch-dtype-conversion-compatibility/56022918?noredirect=1#comment98689941_56022918https://stackoverflow.com/questions/56022497/numpy-pytorch-dtype-conversion-compatibility/56022918?noredirect=1#comment98689941_56022918
https://github.com/ilevkivskyi
ilevkivskyihttps://github.com/ilevkivskyi
on May 7, 2019https://github.com/python/typing/issues/513#issuecomment-490144605
https://github.com/vsiles
vsileshttps://github.com/vsiles
on May 7, 2019https://github.com/python/typing/issues/513#issuecomment-490151189
https://github.com/ilevkivskyi
ilevkivskyihttps://github.com/ilevkivskyi
on May 7, 2019https://github.com/python/typing/issues/513#issuecomment-490185607
https://github.com/dmontagu
dmontaguhttps://github.com/dmontagu
on Jul 10, 2019https://github.com/python/typing/issues/513#issuecomment-510194956
@ilevkivskyihttps://github.com/ilevkivskyi
https://github.com/ilevkivskyi
ilevkivskyihttps://github.com/ilevkivskyi
on Jul 11, 2019https://github.com/python/typing/issues/513#issuecomment-510275933
@dmontaguhttps://github.com/dmontagu
https://github.com/theodoretliu
theodoretliuhttps://github.com/theodoretliu
on Nov 13, 2019https://github.com/python/typing/issues/513#issuecomment-553197589
https://github.com/ilevkivskyi
ilevkivskyihttps://github.com/ilevkivskyi
on Nov 13, 2019https://github.com/python/typing/issues/513#issuecomment-553416849
@theodoretliuhttps://github.com/theodoretliu
https://github.com/python/mypyhttps://github.com/python/mypy
https://github.com/theodoretliu
theodoretliuhttps://github.com/theodoretliu
on Nov 13, 2019https://github.com/python/typing/issues/513#issuecomment-553473384
https://github.com/vsiles
vsileshttps://github.com/vsiles
on Nov 13, 2019https://github.com/python/typing/issues/513#issuecomment-553474425
…https://github.com/python/typing/issues/513
#513https://github.com/python/typing/issues/513
https://github.com/notifications/unsubscribe-auth/ABWLNQFYX3G7RQZDABAIVBLQTQRP3ANCNFSM4EHJIIDQhttps://github.com/notifications/unsubscribe-auth/ABWLNQFYX3G7RQZDABAIVBLQTQRP3ANCNFSM4EHJIIDQ
https://github.com/vsiles
vsileshttps://github.com/vsiles
on Nov 13, 2019https://github.com/python/typing/issues/513#issuecomment-553474787
…https://github.com/python/typing/issues/513
#513https://github.com/python/typing/issues/513
https://github.com/notifications/unsubscribe-auth/ABWLNQFYX3G7RQZDABAIVBLQTQRP3ANCNFSM4EHJIIDQhttps://github.com/notifications/unsubscribe-auth/ABWLNQFYX3G7RQZDABAIVBLQTQRP3ANCNFSM4EHJIIDQ
https://github.com/mrahtz
mrahtzhttps://github.com/mrahtz
on Jun 12, 2020https://github.com/python/typing/issues/513#issuecomment-643229880
https://groups.google.com/g/python-shape-checkershttps://groups.google.com/g/python-shape-checkers
https://github.com/fylux
fyluxhttps://github.com/fylux
on Jun 12, 2020https://github.com/python/typing/issues/513#issuecomment-643240725
@mrahtzhttps://github.com/mrahtz
initial proposalhttps://github.com/facebook/pyre-check/blob/master/docs/Variadic_Type_Variables_for_Decorators_and_Tensors.pdf
mailing listhttps://mail.python.org/archives/list/typing-sig@python.org/
https://github.com/redradist
redradisthttps://github.com/redradist
on Jun 29, 2020https://github.com/python/typing/issues/513#issuecomment-651261165
numpy/numpy#7370https://github.com/numpy/numpy/issues/7370
https://github.com/numpy/numpy_stubshttps://github.com/numpy/numpy_stubs
ideas for array shape typinghttps://docs.google.com/document/d/1vpMse4c6DrWH5rq2tQSx3qwP_m_0lyn-Ij4WHqQqRHY/edit
srittauhttps://github.com/srittau
topic: featureDiscussions about new features for Python's type annotationshttps://github.com/python/typing/issues?q=state%3Aopen%20label%3A%22topic%3A%20feature%22
on Nov 4, 2021https://github.com/python/typing/issues/513#event-5567642086
https://github.com/James4Ever0
James4Ever0https://github.com/James4Ever0
on Jul 7, 2023https://github.com/python/typing/issues/513#issuecomment-1624759073
https://github.com/RBerga06
RBerga06https://github.com/RBerga06
on Jul 21, 2025https://github.com/python/typing/issues/513#issuecomment-3099095211
Rank-typing numpy/numtype#539https://github.com/numpy/numtype/issues/539
Respect fully specialized shape types in operations numpy/numtype#578https://github.com/numpy/numtype/issues/578
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/typing/issues/513
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/typing/issues/513
topic: featureDiscussions about new features for Python's type annotationshttps://github.com/python/typing/issues?q=state%3Aopen%20label%3A%22topic%3A%20feature%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.