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

2022-05-03 Thread bas van beek
I share Ralf’s general sentiment here; the abundance of overloads makes it in my opinion undesirable to move to inline annotations due the sheer amount of extra clutter. This is in part due to dtype-typing support, which is currently difficult to express without overloads, though I do expect th

[Numpy-discussion] Re: PEP 688: Making the buffer protocol accessible in Python

2022-04-26 Thread bas van beek
Hi Jelle, I’ve stumbled upon buffer-related issues multiple times when typing with numpy, be It either with annotating functions such as `np.frombuffer` or when passing a numpy array to the likes of `memoryview` (resulting in a false positive by type checkers). All in all I’d say this buffer-ty

[Numpy-discussion] Re: ndarray typing advise

2022-01-18 Thread bas van beek
l of the headache here, but the numbers-based ABCs are downright useless for static typing in their current state. * Regards, Bas van Beek From: Vincent Schut Sent: 18 January 2022 12:39 To: numpy-discussion@python.org Subject: [Numpy-discussion] Re: nda

[Numpy-discussion] Re: mypy false positives

2022-01-07 Thread bas van beek
suspicious. For reference: ``` finfo_obj = np.finfo(np.float64) reveal_type(finfo_obj.tiny) # Revealed type is "numpy.floating*[numpy.typing._64Bit*]" reveal_type(finfo_obj.foo) # "finfo[floating[_64Bit]]" has no attribute "foo" ``` Regards, Bas van Beek __

[Numpy-discussion] Re: Tensor typing meeting (15 Nov) slides & video

2021-11-17 Thread bas van beek
Thanks for the heads up Stefan, I don't have time right now, but I'll definitely take a look at the recording later. From: Stefan van der Walt Sent: 16 November 2021 20:10 To: Discussion of Numerical Python Subject: [Numpy-discussion] Tensor typing meeting (15 No

[Numpy-discussion] Deprecate np.MachAr?

2021-10-26 Thread bas van beek
Hi all, The subject of `MachAr` recently came up in https://github.com/numpy/numpy/pull/20132 and an earlier community meeting, more notably: it’s questionably role as public (and even private?) API. Ever since the introduction of hard-coded `finfo` parameters back in numpy/numpy#8504 there ha

[Numpy-discussion] Re: Percentile/Quantile "interpolation" refactor

2021-10-21 Thread bas van beek
> Is this Spam? Very much so, I'm afraid. There's been a bit of a spam problem as of late. Regards, Bas From: A.S. Khangura Sent: 21 October 2021 10:24 To: Discussion of Numerical Python Subject: [Numpy-discussion] Re: Percentile/Quantile "interpolation" refacto

Re: [Numpy-discussion] copy="never" discussion and no deprecation cycle?

2021-06-22 Thread bas van beek
> Stefan, that sketch is more complicated than it needs to be - `np.copy` is a > python function, so you can just attach the attributes directly! (although > maybe there are implications for static typing) For the type annotations we can simply use something akin to Stéfans proposed `NpCopy` cl

Re: [Numpy-discussion] Proposals for NumPy 1.22.0

2021-06-10 Thread bas van beek
NEP 29 says December 2021, so that'd be kind of borderline. It would allow us to use positional-only parameters, which would be quite useful. There is currently also a substantial amount of version checks in `numpy.typing` that we could get rid of with python >= 3.8. +1 Regards,

[Numpy-discussion] Deprecate four `ndarray.ctypes` implementation artifacts

2021-05-18 Thread bas van beek
instead) For those interested, a PR implementing their deprecation is currently up at https://github.com/numpy/numpy/pull/19031 Regards, Bas van Beek ___ NumPy-Discussion mailing list NumPy-Discussion@python.org https://mail.python.org/mailman/listinfo

Re: [Numpy-discussion] Catching array shape errors using the type checker

2021-05-04 Thread bas van beek
Hi Matthew and Pradeep, Do you know if the typing summit will be recorded and if these will be made available later? While I’d love to attend the live event, this is unfortunately not possible due to other obligations that day. Regards, Bas From: NumPy-Discussion On Behalf Of Matthew Rahtz

Re: [Numpy-discussion] two questions about `choose`

2021-04-19 Thread bas van beek
After a taking a closer look at the `np.choose` docs I think we should change `choices: npt.ArrayLike` into `choices: Sequence[npt.ArrayLike]`. This would resolve the issue, but it’d also mean that directly passing an array will be prohibited (as far as type checkers are concerned). The docs do

[Numpy-discussion] Ndarray static typing: Order of generic types

2020-10-28 Thread bas van beek
r the other. Are there any further thoughts on this subject? Regards, Bas van Beek ___ NumPy-Discussion mailing list NumPy-Discussion@python.org https://mail.python.org/mailman/listinfo/numpy-discussion