@@ -690,6 +690,7 @@ class dtype(Generic[_DTypeScalar_co]):
690
690
dtype : type [_DTypeScalar_co ],
691
691
align : bool = ...,
692
692
copy : bool = ...,
693
+ metadata : dict [builtins .str , Any ] = ...,
693
694
) -> dtype [_DTypeScalar_co ]: ...
694
695
# Overloads for string aliases, Python types, and some assorted
695
696
# other special cases. Order is sometimes important because of the
@@ -701,108 +702,108 @@ class dtype(Generic[_DTypeScalar_co]):
701
702
# first.
702
703
# Builtin types
703
704
@overload
704
- def __new__ (cls , dtype : type [bool ], align : bool = ..., copy : bool = ...) -> dtype [bool_ ]: ...
705
+ def __new__ (cls , dtype : type [bool ], align : bool = ..., copy : bool = ..., metadata : dict [ builtins . str , Any ] = ... ) -> dtype [bool_ ]: ...
705
706
@overload
706
- def __new__ (cls , dtype : type [int ], align : bool = ..., copy : bool = ...) -> dtype [int_ ]: ...
707
+ def __new__ (cls , dtype : type [int ], align : bool = ..., copy : bool = ..., metadata : dict [ builtins . str , Any ] = ... ) -> dtype [int_ ]: ...
707
708
@overload
708
- def __new__ (cls , dtype : None | type [float ], align : bool = ..., copy : bool = ...) -> dtype [float_ ]: ...
709
+ def __new__ (cls , dtype : None | type [float ], align : bool = ..., copy : bool = ..., metadata : dict [ builtins . str , Any ] = ... ) -> dtype [float_ ]: ...
709
710
@overload
710
- def __new__ (cls , dtype : type [complex ], align : bool = ..., copy : bool = ...) -> dtype [complex_ ]: ...
711
+ def __new__ (cls , dtype : type [complex ], align : bool = ..., copy : bool = ..., metadata : dict [ builtins . str , Any ] = ... ) -> dtype [complex_ ]: ...
711
712
@overload
712
- def __new__ (cls , dtype : type [builtins .str ], align : bool = ..., copy : bool = ...) -> dtype [str_ ]: ...
713
+ def __new__ (cls , dtype : type [builtins .str ], align : bool = ..., copy : bool = ..., metadata : dict [ builtins . str , Any ] = ... ) -> dtype [str_ ]: ...
713
714
@overload
714
- def __new__ (cls , dtype : type [bytes ], align : bool = ..., copy : bool = ...) -> dtype [bytes_ ]: ...
715
+ def __new__ (cls , dtype : type [bytes ], align : bool = ..., copy : bool = ..., metadata : dict [ builtins . str , Any ] = ... ) -> dtype [bytes_ ]: ...
715
716
716
717
# `unsignedinteger` string-based representations and ctypes
717
718
@overload
718
- def __new__ (cls , dtype : _UInt8Codes | type [ct .c_uint8 ], align : bool = ..., copy : bool = ...) -> dtype [uint8 ]: ...
719
+ def __new__ (cls , dtype : _UInt8Codes | type [ct .c_uint8 ], align : bool = ..., copy : bool = ..., metadata : dict [ builtins . str , Any ] = ... ) -> dtype [uint8 ]: ...
719
720
@overload
720
- def __new__ (cls , dtype : _UInt16Codes | type [ct .c_uint16 ], align : bool = ..., copy : bool = ...) -> dtype [uint16 ]: ...
721
+ def __new__ (cls , dtype : _UInt16Codes | type [ct .c_uint16 ], align : bool = ..., copy : bool = ..., metadata : dict [ builtins . str , Any ] = ... ) -> dtype [uint16 ]: ...
721
722
@overload
722
- def __new__ (cls , dtype : _UInt32Codes | type [ct .c_uint32 ], align : bool = ..., copy : bool = ...) -> dtype [uint32 ]: ...
723
+ def __new__ (cls , dtype : _UInt32Codes | type [ct .c_uint32 ], align : bool = ..., copy : bool = ..., metadata : dict [ builtins . str , Any ] = ... ) -> dtype [uint32 ]: ...
723
724
@overload
724
- def __new__ (cls , dtype : _UInt64Codes | type [ct .c_uint64 ], align : bool = ..., copy : bool = ...) -> dtype [uint64 ]: ...
725
+ def __new__ (cls , dtype : _UInt64Codes | type [ct .c_uint64 ], align : bool = ..., copy : bool = ..., metadata : dict [ builtins . str , Any ] = ... ) -> dtype [uint64 ]: ...
725
726
@overload
726
- def __new__ (cls , dtype : _UByteCodes | type [ct .c_ubyte ], align : bool = ..., copy : bool = ...) -> dtype [ubyte ]: ...
727
+ def __new__ (cls , dtype : _UByteCodes | type [ct .c_ubyte ], align : bool = ..., copy : bool = ..., metadata : dict [ builtins . str , Any ] = ... ) -> dtype [ubyte ]: ...
727
728
@overload
728
- def __new__ (cls , dtype : _UShortCodes | type [ct .c_ushort ], align : bool = ..., copy : bool = ...) -> dtype [ushort ]: ...
729
+ def __new__ (cls , dtype : _UShortCodes | type [ct .c_ushort ], align : bool = ..., copy : bool = ..., metadata : dict [ builtins . str , Any ] = ... ) -> dtype [ushort ]: ...
729
730
@overload
730
- def __new__ (cls , dtype : _UIntCCodes | type [ct .c_uint ], align : bool = ..., copy : bool = ...) -> dtype [uintc ]: ...
731
+ def __new__ (cls , dtype : _UIntCCodes | type [ct .c_uint ], align : bool = ..., copy : bool = ..., metadata : dict [ builtins . str , Any ] = ... ) -> dtype [uintc ]: ...
731
732
732
733
# NOTE: We're assuming here that `uint_ptr_t == size_t`,
733
734
# an assumption that does not hold in rare cases (same for `ssize_t`)
734
735
@overload
735
- def __new__ (cls , dtype : _UIntPCodes | type [ct .c_void_p ] | type [ct .c_size_t ], align : bool = ..., copy : bool = ...) -> dtype [uintp ]: ...
736
+ def __new__ (cls , dtype : _UIntPCodes | type [ct .c_void_p ] | type [ct .c_size_t ], align : bool = ..., copy : bool = ..., metadata : dict [ builtins . str , Any ] = ... ) -> dtype [uintp ]: ...
736
737
@overload
737
- def __new__ (cls , dtype : _UIntCodes | type [ct .c_ulong ], align : bool = ..., copy : bool = ...) -> dtype [uint ]: ...
738
+ def __new__ (cls , dtype : _UIntCodes | type [ct .c_ulong ], align : bool = ..., copy : bool = ..., metadata : dict [ builtins . str , Any ] = ... ) -> dtype [uint ]: ...
738
739
@overload
739
- def __new__ (cls , dtype : _ULongLongCodes | type [ct .c_ulonglong ], align : bool = ..., copy : bool = ...) -> dtype [ulonglong ]: ...
740
+ def __new__ (cls , dtype : _ULongLongCodes | type [ct .c_ulonglong ], align : bool = ..., copy : bool = ..., metadata : dict [ builtins . str , Any ] = ... ) -> dtype [ulonglong ]: ...
740
741
741
742
# `signedinteger` string-based representations and ctypes
742
743
@overload
743
- def __new__ (cls , dtype : _Int8Codes | type [ct .c_int8 ], align : bool = ..., copy : bool = ...) -> dtype [int8 ]: ...
744
+ def __new__ (cls , dtype : _Int8Codes | type [ct .c_int8 ], align : bool = ..., copy : bool = ..., metadata : dict [ builtins . str , Any ] = ... ) -> dtype [int8 ]: ...
744
745
@overload
745
- def __new__ (cls , dtype : _Int16Codes | type [ct .c_int16 ], align : bool = ..., copy : bool = ...) -> dtype [int16 ]: ...
746
+ def __new__ (cls , dtype : _Int16Codes | type [ct .c_int16 ], align : bool = ..., copy : bool = ..., metadata : dict [ builtins . str , Any ] = ... ) -> dtype [int16 ]: ...
746
747
@overload
747
- def __new__ (cls , dtype : _Int32Codes | type [ct .c_int32 ], align : bool = ..., copy : bool = ...) -> dtype [int32 ]: ...
748
+ def __new__ (cls , dtype : _Int32Codes | type [ct .c_int32 ], align : bool = ..., copy : bool = ..., metadata : dict [ builtins . str , Any ] = ... ) -> dtype [int32 ]: ...
748
749
@overload
749
- def __new__ (cls , dtype : _Int64Codes | type [ct .c_int64 ], align : bool = ..., copy : bool = ...) -> dtype [int64 ]: ...
750
+ def __new__ (cls , dtype : _Int64Codes | type [ct .c_int64 ], align : bool = ..., copy : bool = ..., metadata : dict [ builtins . str , Any ] = ... ) -> dtype [int64 ]: ...
750
751
@overload
751
- def __new__ (cls , dtype : _ByteCodes | type [ct .c_byte ], align : bool = ..., copy : bool = ...) -> dtype [byte ]: ...
752
+ def __new__ (cls , dtype : _ByteCodes | type [ct .c_byte ], align : bool = ..., copy : bool = ..., metadata : dict [ builtins . str , Any ] = ... ) -> dtype [byte ]: ...
752
753
@overload
753
- def __new__ (cls , dtype : _ShortCodes | type [ct .c_short ], align : bool = ..., copy : bool = ...) -> dtype [short ]: ...
754
+ def __new__ (cls , dtype : _ShortCodes | type [ct .c_short ], align : bool = ..., copy : bool = ..., metadata : dict [ builtins . str , Any ] = ... ) -> dtype [short ]: ...
754
755
@overload
755
- def __new__ (cls , dtype : _IntCCodes | type [ct .c_int ], align : bool = ..., copy : bool = ...) -> dtype [intc ]: ...
756
+ def __new__ (cls , dtype : _IntCCodes | type [ct .c_int ], align : bool = ..., copy : bool = ..., metadata : dict [ builtins . str , Any ] = ... ) -> dtype [intc ]: ...
756
757
@overload
757
- def __new__ (cls , dtype : _IntPCodes | type [ct .c_ssize_t ], align : bool = ..., copy : bool = ...) -> dtype [intp ]: ...
758
+ def __new__ (cls , dtype : _IntPCodes | type [ct .c_ssize_t ], align : bool = ..., copy : bool = ..., metadata : dict [ builtins . str , Any ] = ... ) -> dtype [intp ]: ...
758
759
@overload
759
- def __new__ (cls , dtype : _IntCodes | type [ct .c_long ], align : bool = ..., copy : bool = ...) -> dtype [int_ ]: ...
760
+ def __new__ (cls , dtype : _IntCodes | type [ct .c_long ], align : bool = ..., copy : bool = ..., metadata : dict [ builtins . str , Any ] = ... ) -> dtype [int_ ]: ...
760
761
@overload
761
- def __new__ (cls , dtype : _LongLongCodes | type [ct .c_longlong ], align : bool = ..., copy : bool = ...) -> dtype [longlong ]: ...
762
+ def __new__ (cls , dtype : _LongLongCodes | type [ct .c_longlong ], align : bool = ..., copy : bool = ..., metadata : dict [ builtins . str , Any ] = ... ) -> dtype [longlong ]: ...
762
763
763
764
# `floating` string-based representations and ctypes
764
765
@overload
765
- def __new__ (cls , dtype : _Float16Codes , align : bool = ..., copy : bool = ...) -> dtype [float16 ]: ...
766
+ def __new__ (cls , dtype : _Float16Codes , align : bool = ..., copy : bool = ..., metadata : dict [ builtins . str , Any ] = ... ) -> dtype [float16 ]: ...
766
767
@overload
767
- def __new__ (cls , dtype : _Float32Codes , align : bool = ..., copy : bool = ...) -> dtype [float32 ]: ...
768
+ def __new__ (cls , dtype : _Float32Codes , align : bool = ..., copy : bool = ..., metadata : dict [ builtins . str , Any ] = ... ) -> dtype [float32 ]: ...
768
769
@overload
769
- def __new__ (cls , dtype : _Float64Codes , align : bool = ..., copy : bool = ...) -> dtype [float64 ]: ...
770
+ def __new__ (cls , dtype : _Float64Codes , align : bool = ..., copy : bool = ..., metadata : dict [ builtins . str , Any ] = ... ) -> dtype [float64 ]: ...
770
771
@overload
771
- def __new__ (cls , dtype : _HalfCodes , align : bool = ..., copy : bool = ...) -> dtype [half ]: ...
772
+ def __new__ (cls , dtype : _HalfCodes , align : bool = ..., copy : bool = ..., metadata : dict [ builtins . str , Any ] = ... ) -> dtype [half ]: ...
772
773
@overload
773
- def __new__ (cls , dtype : _SingleCodes | type [ct .c_float ], align : bool = ..., copy : bool = ...) -> dtype [single ]: ...
774
+ def __new__ (cls , dtype : _SingleCodes | type [ct .c_float ], align : bool = ..., copy : bool = ..., metadata : dict [ builtins . str , Any ] = ... ) -> dtype [single ]: ...
774
775
@overload
775
- def __new__ (cls , dtype : _DoubleCodes | type [ct .c_double ], align : bool = ..., copy : bool = ...) -> dtype [double ]: ...
776
+ def __new__ (cls , dtype : _DoubleCodes | type [ct .c_double ], align : bool = ..., copy : bool = ..., metadata : dict [ builtins . str , Any ] = ... ) -> dtype [double ]: ...
776
777
@overload
777
- def __new__ (cls , dtype : _LongDoubleCodes | type [ct .c_longdouble ], align : bool = ..., copy : bool = ...) -> dtype [longdouble ]: ...
778
+ def __new__ (cls , dtype : _LongDoubleCodes | type [ct .c_longdouble ], align : bool = ..., copy : bool = ..., metadata : dict [ builtins . str , Any ] = ... ) -> dtype [longdouble ]: ...
778
779
779
780
# `complexfloating` string-based representations
780
781
@overload
781
- def __new__ (cls , dtype : _Complex64Codes , align : bool = ..., copy : bool = ...) -> dtype [complex64 ]: ...
782
+ def __new__ (cls , dtype : _Complex64Codes , align : bool = ..., copy : bool = ..., metadata : dict [ builtins . str , Any ] = ... ) -> dtype [complex64 ]: ...
782
783
@overload
783
- def __new__ (cls , dtype : _Complex128Codes , align : bool = ..., copy : bool = ...) -> dtype [complex128 ]: ...
784
+ def __new__ (cls , dtype : _Complex128Codes , align : bool = ..., copy : bool = ..., metadata : dict [ builtins . str , Any ] = ... ) -> dtype [complex128 ]: ...
784
785
@overload
785
- def __new__ (cls , dtype : _CSingleCodes , align : bool = ..., copy : bool = ...) -> dtype [csingle ]: ...
786
+ def __new__ (cls , dtype : _CSingleCodes , align : bool = ..., copy : bool = ..., metadata : dict [ builtins . str , Any ] = ... ) -> dtype [csingle ]: ...
786
787
@overload
787
- def __new__ (cls , dtype : _CDoubleCodes , align : bool = ..., copy : bool = ...) -> dtype [cdouble ]: ...
788
+ def __new__ (cls , dtype : _CDoubleCodes , align : bool = ..., copy : bool = ..., metadata : dict [ builtins . str , Any ] = ... ) -> dtype [cdouble ]: ...
788
789
@overload
789
- def __new__ (cls , dtype : _CLongDoubleCodes , align : bool = ..., copy : bool = ...) -> dtype [clongdouble ]: ...
790
+ def __new__ (cls , dtype : _CLongDoubleCodes , align : bool = ..., copy : bool = ..., metadata : dict [ builtins . str , Any ] = ... ) -> dtype [clongdouble ]: ...
790
791
791
792
# Miscellaneous string-based representations and ctypes
792
793
@overload
793
- def __new__ (cls , dtype : _BoolCodes | type [ct .c_bool ], align : bool = ..., copy : bool = ...) -> dtype [bool_ ]: ...
794
+ def __new__ (cls , dtype : _BoolCodes | type [ct .c_bool ], align : bool = ..., copy : bool = ..., metadata : dict [ builtins . str , Any ] = ... ) -> dtype [bool_ ]: ...
794
795
@overload
795
- def __new__ (cls , dtype : _TD64Codes , align : bool = ..., copy : bool = ...) -> dtype [timedelta64 ]: ...
796
+ def __new__ (cls , dtype : _TD64Codes , align : bool = ..., copy : bool = ..., metadata : dict [ builtins . str , Any ] = ... ) -> dtype [timedelta64 ]: ...
796
797
@overload
797
- def __new__ (cls , dtype : _DT64Codes , align : bool = ..., copy : bool = ...) -> dtype [datetime64 ]: ...
798
+ def __new__ (cls , dtype : _DT64Codes , align : bool = ..., copy : bool = ..., metadata : dict [ builtins . str , Any ] = ... ) -> dtype [datetime64 ]: ...
798
799
@overload
799
- def __new__ (cls , dtype : _StrCodes , align : bool = ..., copy : bool = ...) -> dtype [str_ ]: ...
800
+ def __new__ (cls , dtype : _StrCodes , align : bool = ..., copy : bool = ..., metadata : dict [ builtins . str , Any ] = ... ) -> dtype [str_ ]: ...
800
801
@overload
801
- def __new__ (cls , dtype : _BytesCodes | type [ct .c_char ], align : bool = ..., copy : bool = ...) -> dtype [bytes_ ]: ...
802
+ def __new__ (cls , dtype : _BytesCodes | type [ct .c_char ], align : bool = ..., copy : bool = ..., metadata : dict [ builtins . str , Any ] = ... ) -> dtype [bytes_ ]: ...
802
803
@overload
803
- def __new__ (cls , dtype : _VoidCodes , align : bool = ..., copy : bool = ...) -> dtype [void ]: ...
804
+ def __new__ (cls , dtype : _VoidCodes , align : bool = ..., copy : bool = ..., metadata : dict [ builtins . str , Any ] = ... ) -> dtype [void ]: ...
804
805
@overload
805
- def __new__ (cls , dtype : _ObjectCodes | type [ct .py_object ] , align : bool = ..., copy : bool = ...) -> dtype [object_ ]: ...
806
+ def __new__ (cls , dtype : _ObjectCodes | type [ct .py_object [ Any ]] , align : bool = ..., copy : bool = ..., metadata : dict [ builtins . str , Any ] = ...) -> dtype [object_ ]: ...
806
807
807
808
# dtype of a dtype is the same dtype
808
809
@overload
@@ -811,13 +812,15 @@ class dtype(Generic[_DTypeScalar_co]):
811
812
dtype : dtype [_DTypeScalar_co ],
812
813
align : bool = ...,
813
814
copy : bool = ...,
815
+ metadata : dict [builtins .str , Any ] = ...,
814
816
) -> dtype [_DTypeScalar_co ]: ...
815
817
@overload
816
818
def __new__ (
817
819
cls ,
818
820
dtype : _SupportsDType [dtype [_DTypeScalar_co ]],
819
821
align : bool = ...,
820
822
copy : bool = ...,
823
+ metadata : dict [builtins .str , Any ] = ...,
821
824
) -> dtype [_DTypeScalar_co ]: ...
822
825
# Handle strings that can't be expressed as literals; i.e. s1, s2, ...
823
826
@overload
@@ -826,6 +829,7 @@ class dtype(Generic[_DTypeScalar_co]):
826
829
dtype : builtins .str ,
827
830
align : bool = ...,
828
831
copy : bool = ...,
832
+ metadata : dict [builtins .str , Any ] = ...,
829
833
) -> dtype [Any ]: ...
830
834
# Catchall overload for void-likes
831
835
@overload
@@ -834,6 +838,7 @@ class dtype(Generic[_DTypeScalar_co]):
834
838
dtype : _VoidDTypeLike ,
835
839
align : bool = ...,
836
840
copy : bool = ...,
841
+ metadata : dict [builtins .str , Any ] = ...,
837
842
) -> dtype [void ]: ...
838
843
# Catchall overload for object-likes
839
844
@overload
@@ -842,6 +847,7 @@ class dtype(Generic[_DTypeScalar_co]):
842
847
dtype : type [object ],
843
848
align : bool = ...,
844
849
copy : bool = ...,
850
+ metadata : dict [builtins .str , Any ] = ...,
845
851
) -> dtype [object_ ]: ...
846
852
847
853
if sys .version_info >= (3 , 9 ):
0 commit comments