galois.typing.DTypeLike

galois.typing.DTypeLike

A Union representing objects that can be coerced into a NumPy data type.

Union

  • numpy.integer: A fixed-width NumPy integer data type.

    In [1]: GF = galois.GF(3**5)
    
    In [2]: x = GF.Random(4, dtype=np.uint16); x.dtype
    Out[2]: dtype('uint16')
    
    In [3]: x = GF.Random(4, dtype=np.int32); x.dtype
    Out[3]: dtype('int32')
    
  • int: The system default integer.

    In [4]: x = GF.Random(4, dtype=int); x.dtype
    Out[4]: dtype('int64')
    
  • str: The string that can be coerced with numpy.dtype.

    In [5]: x = GF.Random(4, dtype="uint16"); x.dtype
    Out[5]: dtype('uint16')
    
    In [6]: x = GF.Random(4, dtype="int32"); x.dtype
    Out[6]: dtype('int32')
    
  • object: A Python object data type. This applies to non-compiled fields.

    In [7]: GF = galois.GF(2**100)
    
    In [8]: x = GF.Random(4, dtype=object); x.dtype
    Out[8]: dtype('O')
    

Alias

alias of Union[integer, int, str, object]


Last update: May 17, 2022