Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Public _ArrayLike*_co + non-coercible aliases for all dtypes, scalars, and arrays #135

Open
jorenham opened this issue Feb 14, 2025 · 1 comment

Comments

@jorenham
Copy link
Member

jorenham commented Feb 14, 2025

Requires #137


For reference, here's the type-promotion table for numpy.result_type

b i1 i2 i4 i8 u1 u2 u4 u8 f2 f4 f8 g c8 c16 G m M
bool ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
int ^ ^ ^ ^ ^ ^
float ^ ^ ^ ^
complex ^ ^
b = ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
i1 = ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
i2 = ^ ^ ^ ^ ^ ^ ^ ^ ^
i4 = ^ ^ ^ ^ ^ ^
i8 = ^ ^ ^ ^ ^
u1 ^ ^ ^ = ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
u2 ^ ^ = ^ ^ ^ ^ ^ ^ ^ ^ ^
u4 ^ = ^ ^ ^ ^ ^ ^
u8 = ^ ^ ^ ^
f2 = ^ ^ ^ ^ ^ ^
f4 = ^ ^ ^ ^ ^
f8 = ^ ^ ^
g = ^
c8 = ^ ^
c16 = ^
G =
m = ^
M =

The columns can be promoted to rows if ^ or = according to numpy.result_type.


And this one is for scalars, based on __add__:

b i1 i2 i4 i8 u1 u2 u4 u8 f2 f4 f8 g c8 c16 G m M
bool ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
int ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
float ^ ^ ^ ^ ^ ^ ^
complex ^ ^ ^
b = ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
i1 = ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
i2 = ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
i4 = ^ ^ ^ ^ ^ ^ ^
i8 = ^ ^ ^ ^ ^ ^
u1 ^ ^ ^ = ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
u2 ^ ^ = ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
u4 ^ = ^ ^ ^ ^ ^ ^ ^
u8 = ^ ^ ^ ^ ^ ^
f2 = ^ ^ ^ ^ ^ ^
f4 = ^ ^ ^ ^ ^
f8 = ^ ^ ^
g = ^
c8 = ^ ^
c16 = ^
G =
m = ^
M =
@jorenham
Copy link
Member Author

With #137 this should be possible to do with a single type alias (!), instead of >20.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant