home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 1424215477

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
1424215477 I_kwDOAMm_X85U4821 7227 Typing with Variadic Generics in python 3.11 (PEP 646) 35968931 open 0     5 2022-10-26T15:03:01Z 2022-10-26T21:50:02Z   MEMBER      

What is your issue?

I just saw this new typing feature in python 3.11, and I'm wondering whether / where we could usefully use this? The feature is parametrizing Generics with arbitrary numbers of TypeVars, which allows you to have Array types whose static typing behaviour is a function of their shape. (But we could possibly use it for a tuple of dims too...) We might use it to do things like:

  • Specify that a function expects an array of a certain dimensionality
  • Overload methods based on the array dimensionality (e.g. .plot for 1D vs 2D arrays)
  • (If they implement Shape Arithmetic) Type hint how certain methods will change the output shape?

@headtr1ck @max-sixty any thoughts?

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7227/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    13221727 issue

Links from other tables

  • 1 row from issues_id in issues_labels
  • 5 rows from issue in issue_comments
Powered by Datasette · Queries took 0.636ms · About: xarray-datasette