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](https://www.python.org/dev/peps/pep-0563/). 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](https://www.python.org/dev/peps/pep-0604/) 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](https://mail.python.org/archives/list/python-dev@python.org/thread/CLVXXPQ2T2LQ5MP2Y53VVQFCXYWQJHKZ/) 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