<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/python-packages/numpy.git/numpy/typing/_shape.py, branch issue_20025</title>
<subtitle>github.com: numpy/numpy.git
</subtitle>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/numpy.git/'/>
<entry>
<title>MAINT: Drop .py code-paths specific to Python 3.7</title>
<updated>2021-08-30T13:26:54+00:00</updated>
<author>
<name>Bas van Beek</name>
<email>43369155+BvB93@users.noreply.github.com</email>
</author>
<published>2021-08-14T19:39:50+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/numpy.git/commit/?id=d0b676b77bfa567eddb925bc31ead24ff0b576b1'/>
<id>d0b676b77bfa567eddb925bc31ead24ff0b576b1</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>REV,BUG: Replace `NotImplemented` with `typing.Any`</title>
<updated>2021-06-05T21:35:11+00:00</updated>
<author>
<name>Bas van Beek</name>
<email>43369155+BvB93@users.noreply.github.com</email>
</author>
<published>2021-06-05T21:35:11+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/numpy.git/commit/?id=7162dc3c9f3cc02434c50dfb4e55b790453c00a4'/>
<id>7162dc3c9f3cc02434c50dfb4e55b790453c00a4</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>ENH: Add a global constant to `numpy.typing` denoting whether or not `typing_extensions` is available</title>
<updated>2021-05-27T15:24:04+00:00</updated>
<author>
<name>Bas van Beek</name>
<email>b.f.van.beek@vu.nl</email>
</author>
<published>2021-05-24T12:45:49+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/numpy.git/commit/?id=66fa0481c0dd85d4f90dc56afe3f1b42b96945ad'/>
<id>66fa0481c0dd85d4f90dc56afe3f1b42b96945ad</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>MAINT: Relax the integer-type-constraint of `npt._ShapeLike`</title>
<updated>2021-04-14T21:11:09+00:00</updated>
<author>
<name>Bas van Beek</name>
<email>b.f.van.beek@vu.nl</email>
</author>
<published>2021-04-14T21:11:09+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/numpy.git/commit/?id=7afccd97397a6f102b83ae4c0e0f77e0fbde435c'/>
<id>7afccd97397a6f102b83ae4c0e0f77e0fbde435c</id>
<content type='text'>
Change `int` into the more forgiving `SupportsIndex` protocol
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change `int` into the more forgiving `SupportsIndex` protocol
</pre>
</div>
</content>
</entry>
<entry>
<title>MAINT: make typing module available at runtime</title>
<updated>2020-06-10T05:06:13+00:00</updated>
<author>
<name>Josh Wilson</name>
<email>person142@users.noreply.github.com</email>
</author>
<published>2020-06-10T04:21:40+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/numpy.git/commit/?id=8e8a8f15970822a6242dc2ecba2ba4947204b4bb'/>
<id>8e8a8f15970822a6242dc2ecba2ba4947204b4bb</id>
<content type='text'>
Closes https://github.com/numpy/numpy/issues/16550.

This makes `np.typing.ArrayLike` and `np.typing.DtypeLike` available
at runtime in addition to typing time. Some things to consider:

- `ArrayLike` uses protocols, which are only in the standard library
  in 3.8+, but are backported in `typing_extensions`. This
  conditionally imports `Protocol` and sets `_SupportsArray` to `Any`
  at runtime if the module is not available to prevent NumPy from
  having a hard dependency on `typing_extensions`. Since e.g. mypy
  already includes `typing_extensions` as a dependency, anybody
  actually doing type checking will have it set correctly.
- We are starting to hit the edges of "the fiction of the stubs". In
  particular, they could just cram everything into `__init__.pyi` and
  ignore the real structure of NumPy. But now that typing is available
  a runtime, we have to e.g. carefully import `ndarray` from `numpy`
  in the typing module and not from `..core.multiarray`, because
  otherwise mypy will think you are talking about a different
  ndarray. We will probably need to do some shuffling the stubs into
  more fitting locations to mitigate weirdness like this.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Closes https://github.com/numpy/numpy/issues/16550.

This makes `np.typing.ArrayLike` and `np.typing.DtypeLike` available
at runtime in addition to typing time. Some things to consider:

- `ArrayLike` uses protocols, which are only in the standard library
  in 3.8+, but are backported in `typing_extensions`. This
  conditionally imports `Protocol` and sets `_SupportsArray` to `Any`
  at runtime if the module is not available to prevent NumPy from
  having a hard dependency on `typing_extensions`. Since e.g. mypy
  already includes `typing_extensions` as a dependency, anybody
  actually doing type checking will have it set correctly.
- We are starting to hit the edges of "the fiction of the stubs". In
  particular, they could just cram everything into `__init__.pyi` and
  ignore the real structure of NumPy. But now that typing is available
  a runtime, we have to e.g. carefully import `ndarray` from `numpy`
  in the typing module and not from `..core.multiarray`, because
  otherwise mypy will think you are talking about a different
  ndarray. We will probably need to do some shuffling the stubs into
  more fitting locations to mitigate weirdness like this.
</pre>
</div>
</content>
</entry>
</feed>
