`same_kind` casting type-aliases

Open
#551 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
numpy, python

Research direction

The issue names no files or tests. Start by locating the existing _numtype aliases that implement the casting='safe' rules, then compare them with the requested same_kind table. Done means equivalent same-kind type-aliases are implemented and their behavior is verified against the table.

Written by the indexing model from the issue text.

Description

_numtype topic: NEP 50

Currently, only the safe (NEP 50) casting rules are implemented (as _numtype type-aliases). For the sake of completeness, the same-kind should also have similar type-aliases.

casting = 'safe'

b1  ->  b1  u1  u2  u4  u8  i1  i2  i4  i8  m8  f2  f4  f8  c8 c16  S   U   T   V   O     
u1  ->      u1  u2  u4  u8      i2  i4  i8  m8  f2  f4  f8  c8 c16  S   U   T   V   O     
u2  ->          u2  u4  u8          i4  i8  m8      f4  f8  c8 c16  S   U   T   V   O     
u4  ->              u4  u8              i8  m8          f8     c16  S   U   T   V   O     
u8  ->                  u8                              f8     c16  S   U   T   V   O     
i1  ->                      i1  i2  i4  i8  m8  f2  f4  f8  c8 c16  S   U   T   V   O     
i2  ->                          i2  i4  i8  m8      f4  f8  c8 c16  S   U   T   V   O     
i4  ->                              i4  i8  m8          f8     c16  S   U   T   V   O     
i8  ->                                  i8  m8          f8     c16  S   U   T   V   O     
m8  ->                                      m8                              T   V   O     
f2  ->                                          f2  f4  f8  c8 c16  S   U   T   V   O     
f4  ->                                              f4  f8  c8 c16  S   U   T   V   O     
f8  ->                                                  f8     c16  S   U   T   V   O     
c8  ->                                                      c8 c16  S   U   T   V   O     
c16 ->                                                         c16  S   U   T   V   O     
S   ->                                                              S   U       V   O     
U   ->                                                                  U       V   O     
T   ->                                                                      T       O     
V   ->                                                                          V   O     
O   ->                                                                              O     
M8  ->                                                                      T   V   O   M8

casting = 'same_kind'

b1  ->  b1  u1  u2  u4  u8  i1  i2  i4  i8  m8  f2  f4  f8  c8 c16  S   U   T   V   O     
u1  ->      u1  u2  u4  u8  i1  i2  i4  i8  m8  f2  f4  f8  c8 c16  S   U   T   V   O     
u2  ->      u1  u2  u4  u8  i1  i2  i4  i8  m8  f2  f4  f8  c8 c16  S   U   T   V   O     
u4  ->      u1  u2  u4  u8  i1  i2  i4  i8  m8  f2  f4  f8  c8 c16  S   U   T   V   O     
u8  ->      u1  u2  u4  u8  i1  i2  i4  i8  m8  f2  f4  f8  c8 c16  S   U   T   V   O     
i1  ->                      i1  i2  i4  i8  m8  f2  f4  f8  c8 c16  S   U   T   V   O     
i2  ->                      i1  i2  i4  i8  m8  f2  f4  f8  c8 c16  S   U   T   V   O     
i4  ->                      i1  i2  i4  i8  m8  f2  f4  f8  c8 c16  S   U   T   V   O     
i8  ->                      i1  i2  i4  i8  m8  f2  f4  f8  c8 c16  S   U   T   V   O     
m8  ->                                      m8                              T   V   O     
f2  ->                                          f2  f4  f8  c8 c16  S   U   T   V   O     
f4  ->                                          f2  f4  f8  c8 c16  S   U   T   V   O     
f8  ->                                          f2  f4  f8  c8 c16  S   U   T   V   O     
c8  ->                                                      c8 c16  S   U   T   V   O     
c16 ->                                                      c8 c16  S   U   T   V   O     
S   ->                                                              S   U   T   V   O     
U   ->                                                                  U   T   V   O     
T   ->  b1                                                          S   U   T   V   O     
V   ->                                                                      T   V   O     
O   ->                                                                              O     
M8  ->                                                                      T   V   O   M8
Dominant language
Python
Stars
79
Forks
8
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from numpy/numtype

All issues in numpy/numtype

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.