Re: [Numpy-discussion] New DTypes: Are scalars a central concept in NumPy or not?

2020-02-25 Thread Stefano Miccoli
The fact that `isinstance(np.float64(1), float)` raises the problem that the 
current
implementation of np.float64 scalars breaks the Liskov substitution principle:
`sequence_or_array[round(x)]` works if `x` is a float, but breaks down if x is 
a np.float64.

See https://github.com/numpy/numpy/issues/11810, where the issue is discussed 
in the
broader setting of the semantics of `np.round` vs. python3 `round`.

I do not have a strong opinion here, except that if np.float64’s are within the 
python
number hierarchy they should be PEP 3141 compliant (which currently they are 
not.)

Stefano

> On 25 Feb 2020, at 00:03, numpy-discussion-requ...@python.org wrote:
> 
> Also, something to think about is that currently numpy scalars satisfy
> the property `isinstance(np.float64(1), float)`, i.e they are within the
> python numerical type hierarchy. 0d arrays do not have this property. My
> proposal above would break this. I'm not sure what to think about
> whether this is a good property to maintain or not.
> 
> Cheers,
> Allan

___
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] NumPy Development Meeting - Triage Focus

2020-02-25 Thread Sebastian Berg
Hi all,

Our bi-weekly triage-focused NumPy development meeting is tomorrow
(Wednesday, Februrary 26) at 11 am Pacific Time. Everyone is invited
to join in and edit the work-in-progress meeting topics and notes:
https://hackmd.io/68i_JvOYQfy9ERiHgXMPvg

I encourage everyone to notify us of issues or PRs that you feel should
be prioritized or simply discussed briefly. Just comment on it so we
can label it, or add your PR/issue to this weeks topics for discussion.

Best regards,

Sebastian


signature.asc
Description: This is a digitally signed message part
___
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion