chararray.pyi 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. import numpy as np
  2. from typing import Any
  3. AR_U: np.chararray[Any, np.dtype[np.str_]]
  4. AR_S: np.chararray[Any, np.dtype[np.bytes_]]
  5. AR_S.encode() # E: Invalid self argument
  6. AR_U.decode() # E: Invalid self argument
  7. AR_U.join(b"_") # E: incompatible type
  8. AR_S.join("_") # E: incompatible type
  9. AR_U.ljust(5, fillchar=b"a") # E: incompatible type
  10. AR_S.ljust(5, fillchar="a") # E: incompatible type
  11. AR_U.rjust(5, fillchar=b"a") # E: incompatible type
  12. AR_S.rjust(5, fillchar="a") # E: incompatible type
  13. AR_U.lstrip(chars=b"a") # E: incompatible type
  14. AR_S.lstrip(chars="a") # E: incompatible type
  15. AR_U.strip(chars=b"a") # E: incompatible type
  16. AR_S.strip(chars="a") # E: incompatible type
  17. AR_U.rstrip(chars=b"a") # E: incompatible type
  18. AR_S.rstrip(chars="a") # E: incompatible type
  19. AR_U.partition(b"a") # E: incompatible type
  20. AR_S.partition("a") # E: incompatible type
  21. AR_U.rpartition(b"a") # E: incompatible type
  22. AR_S.rpartition("a") # E: incompatible type
  23. AR_U.replace(b"_", b"-") # E: incompatible type
  24. AR_S.replace("_", "-") # E: incompatible type
  25. AR_U.split(b"_") # E: incompatible type
  26. AR_S.split("_") # E: incompatible type
  27. AR_S.split(1) # E: incompatible type
  28. AR_U.rsplit(b"_") # E: incompatible type
  29. AR_S.rsplit("_") # E: incompatible type
  30. AR_U.count(b"a", start=[1, 2, 3]) # E: incompatible type
  31. AR_S.count("a", end=9) # E: incompatible type
  32. AR_U.endswith(b"a", start=[1, 2, 3]) # E: incompatible type
  33. AR_S.endswith("a", end=9) # E: incompatible type
  34. AR_U.startswith(b"a", start=[1, 2, 3]) # E: incompatible type
  35. AR_S.startswith("a", end=9) # E: incompatible type
  36. AR_U.find(b"a", start=[1, 2, 3]) # E: incompatible type
  37. AR_S.find("a", end=9) # E: incompatible type
  38. AR_U.rfind(b"a", start=[1, 2, 3]) # E: incompatible type
  39. AR_S.rfind("a", end=9) # E: incompatible type
  40. AR_U.index(b"a", start=[1, 2, 3]) # E: incompatible type
  41. AR_S.index("a", end=9) # E: incompatible type
  42. AR_U.rindex(b"a", start=[1, 2, 3]) # E: incompatible type
  43. AR_S.rindex("a", end=9) # E: incompatible type
  44. AR_U == AR_S # E: Unsupported operand types
  45. AR_U != AR_S # E: Unsupported operand types
  46. AR_U >= AR_S # E: Unsupported operand types
  47. AR_U <= AR_S # E: Unsupported operand types
  48. AR_U > AR_S # E: Unsupported operand types
  49. AR_U < AR_S # E: Unsupported operand types