@@ -555,6 +555,14 @@ class _Variable:
555555
556556 def __init__ (self , dset : Dataset , varname : str , var : Variable [Any ], recdimname : str ) -> None : ...
557557
558+ # shape, ndim, and name actually come from __getattr__
559+ @property
560+ def shape (self ) -> tuple [int , ...]: ...
561+ @property
562+ def ndim (self ) -> int : ...
563+ @property
564+ def name (self ) -> str : ...
565+
558566 def typecode (self ) -> np .dtype | type [str ]: ...
559567 def ncattrs (self ) -> list [str ]: ...
560568 def _shape (self ) -> tuple [int , ...]: ...
@@ -582,9 +590,38 @@ class MFTime(_Variable):
582590 def __getitem__ (self , elem : GetSetItemKey ) -> np .ndarray : ...
583591
584592
585- def stringtoarr (string , NUMCHARS : int , dtype : Literal ['S' , 'U' ] = 'S' ) -> np .ndarray : ...
586- def stringtochar (a , encoding : str | bytes | None = 'utf-8' ) -> np .ndarray : ...
587- def chartostring (b , encoding : str | bytes | None = 'utf-8' ) -> np .ndarray : ...
593+ @overload
594+ def stringtoarr (
595+ string : str ,
596+ NUMCHARS : int ,
597+ dtype : Literal ["S" ] | np .dtype [np .bytes_ ]= "S" ,
598+ ) -> npt .NDArray [np .bytes_ ]: ...
599+ @overload
600+ def stringtoarr (
601+ string : str ,
602+ NUMCHARS : int ,
603+ dtype : Literal ["U" ] | np .dtype [np .str_ ],
604+ ) -> npt .NDArray [np .str_ ]: ...
605+ @overload
606+ def stringtochar (
607+ a : npt .NDArray [np .character ],
608+ encoding : Literal ["none" , "None" , "bytes" ],
609+ ) -> npt .NDArray [np .bytes_ ]: ...
610+ @overload
611+ def stringtochar (
612+ a : npt .NDArray [np .character ],
613+ encoding : str = ...,
614+ ) -> npt .NDArray [np .str_ ] | npt .NDArray [np .bytes_ ]: ...
615+ @overload
616+ def chartostring (
617+ b : npt .NDArray [np .character ],
618+ encoding : Literal ["none" , "None" , "bytes" ] = ...,
619+ ) -> npt .NDArray [np .bytes_ ]: ...
620+ @overload
621+ def chartostring (
622+ b : npt .NDArray [np .character ],
623+ encoding : str = ...,
624+ ) -> npt .NDArray [np .str_ ] | npt .NDArray [np .bytes_ ]: ...
588625
589626def getlibversion () -> str : ...
590627
0 commit comments