[Numpy-discussion] Re: Types in pure Python sources

2022-05-01 Thread Ralf Gommers
On Sat, Apr 30, 2022 at 4:51 PM Sergei Lebedev wrote: > Hi everyone, > > I've noticed that NumPy currently users separate type stub files for > specifying types for both pure Python and native modules. For example the > (untyped) implementation of np.core._asarray is in [1], but the types are > i

[Numpy-discussion] Re: Types in pure Python sources

2022-05-01 Thread Sergei Lebedev
> I think that's on purpose, because the type annotations are quite complex. > For reasons of correctness/completeleness, they use protocols, mixins, and > overloads. Inside pure Python code, that would be harder to read and > maintain. I agree that NumPy type annotations are quite complex. Howeve