[Numpy-discussion] Types in pure Python sources

2022-04-30 Thread Sergei Lebedev
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 in [2]. This works fine for type checkers, and if anything, impro

[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