home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 958130347

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions performed_via_github_app issue
https://github.com/pydata/xarray/pull/5871#issuecomment-958130347 https://api.github.com/repos/pydata/xarray/issues/5871 958130347 IC_kwDOAMm_X845G-ir 31640292 2021-11-02T20:11:23Z 2021-11-02T20:11:23Z CONTRIBUTOR

the new |-operator

from __future__ import annotations does not actually directly enable the use of | for union, it changes the semantics of type annotations to postpone evaluation. In particular, you can then put just about anything in the type annotation without having any runtime behavior:

python from __future__ import annotations def foo(bar: print('hi')) -> None: pass

This is separate from PEP 604 which actually does change the syntax.

Tools like mypy will catch obvious errors like the above, and support | if they are versioned sufficiently, but it's probably not a good idea to change unless you're certain that postponing evaluation is correct (Python itself has delayed making this the default to resolve some other issues).

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  1028110240
Powered by Datasette · Queries took 0.66ms · About: xarray-datasette