Hi all, I am not as such against adding more bit-wise functions. But, I think if we do, we probably need to discuss namespaces. (because adding this is a slippery slope to also adding countr/countl, etc. Unless we can just decide now to add all and those are actually few.)
True, `bitwise_` naming convention is similar, but there is always concern about the main namespace being too big to add functions that don't have wide application. (Or in other words maybe: Without that, there may need to be a strong argument that this function will be used enough to be worthwhile.) (There was some old discussion around this when we added `bitwise_count`, but may be old enough to not be all that interesting anymore.) Also always good to mention that it is very easy to create a small package with a family of bitwise functions outside of NumPy, like e.g. `ufunclab` [1]. (And the numpy docs could link to it in the "See also" section for example.) - Sebastian [1] https://github.com/WarrenWeckesser/ufunclab On Thu, 2025-03-06 at 18:08 +0000, Carlos Martin wrote: > Feature request: Add a `bit_width` function to NumPy's [bit-wise > operations]( > https://numpy.org/doc/stable/reference/routines.bitwise.html) that > computes the [bit-width](https://en.wikipedia.org/wiki/Bit-width) > (also called bit-length) of an input. > > For an example, see C++'s > [`bit_width`](https://en.cppreference.com/w/cpp/numeric/bit_width) > function. > _______________________________________________ > NumPy-Discussion mailing list -- numpy-discussion@python.org > To unsubscribe send an email to numpy-discussion-le...@python.org > https://mail.python.org/mailman3/lists/numpy-discussion.python.org/ > Member address: sebast...@sipsolutions.net > _______________________________________________ NumPy-Discussion mailing list -- numpy-discussion@python.org To unsubscribe send an email to numpy-discussion-le...@python.org https://mail.python.org/mailman3/lists/numpy-discussion.python.org/ Member address: arch...@mail-archive.com