ufunclike.pyi 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. from typing import Any, overload, TypeVar
  2. from numpy import floating, bool_, object_, ndarray
  3. from numpy._typing import (
  4. NDArray,
  5. _FloatLike_co,
  6. _ArrayLikeFloat_co,
  7. _ArrayLikeObject_co,
  8. )
  9. _ArrayType = TypeVar("_ArrayType", bound=ndarray[Any, Any])
  10. __all__: list[str]
  11. @overload
  12. def fix( # type: ignore[misc]
  13. x: _FloatLike_co,
  14. out: None = ...,
  15. ) -> floating[Any]: ...
  16. @overload
  17. def fix(
  18. x: _ArrayLikeFloat_co,
  19. out: None = ...,
  20. ) -> NDArray[floating[Any]]: ...
  21. @overload
  22. def fix(
  23. x: _ArrayLikeObject_co,
  24. out: None = ...,
  25. ) -> NDArray[object_]: ...
  26. @overload
  27. def fix(
  28. x: _ArrayLikeFloat_co | _ArrayLikeObject_co,
  29. out: _ArrayType,
  30. ) -> _ArrayType: ...
  31. @overload
  32. def isposinf( # type: ignore[misc]
  33. x: _FloatLike_co,
  34. out: None = ...,
  35. ) -> bool_: ...
  36. @overload
  37. def isposinf(
  38. x: _ArrayLikeFloat_co,
  39. out: None = ...,
  40. ) -> NDArray[bool_]: ...
  41. @overload
  42. def isposinf(
  43. x: _ArrayLikeFloat_co,
  44. out: _ArrayType,
  45. ) -> _ArrayType: ...
  46. @overload
  47. def isneginf( # type: ignore[misc]
  48. x: _FloatLike_co,
  49. out: None = ...,
  50. ) -> bool_: ...
  51. @overload
  52. def isneginf(
  53. x: _ArrayLikeFloat_co,
  54. out: None = ...,
  55. ) -> NDArray[bool_]: ...
  56. @overload
  57. def isneginf(
  58. x: _ArrayLikeFloat_co,
  59. out: _ArrayType,
  60. ) -> _ArrayType: ...