mypy icon indicating copy to clipboard operation
mypy copied to clipboard

Add initial `LiteralString` support

Open sobolevn opened this issue 1 year ago • 13 comments

I went for the smallest possible diff in this feature. There are couple of other options I did not want to go with:

  • class LiteralStringType and using it in last_known_value. There are lots of places where .last_known_value is used for literal context checking. In this case we would also need to add new visitor methods to every type visitor, which is way harder
  • Fake LiteralString(str) type info
  • Fake LiteralString with _promote hackery

TODO in the next PRs:

  • Literal type math: https://github.com/python/mypy/issues/11990 This will allow us to automatically support things like x: LiteralString = 'a' + 'b'
  • More tests and use-cases
  • Removing --enable-incomplete-features flag from this feature

Refs https://github.com/python/mypy/issues/12554

sobolevn avatar Sep 14 '22 10:09 sobolevn

Current failures show that we need to special case this:

x = 'a'
x = 'Value: {}'.format(x)

sobolevn avatar Sep 14 '22 10:09 sobolevn

Diff from mypy_primer, showing the effect of this PR on open source code:

pyinstrument (https://github.com/joerick/pyinstrument)
+ pyinstrument/renderers/speedscope.py:225: error: Argument 3 to "SpeedscopeFile" has incompatible type "Dict[LiteralString, List[SpeedscopeFrame]]"; expected "Dict[str, List[SpeedscopeFrame]]"

ignite (https://github.com/pytorch/ignite)
+ ignite/engine/events.py:430: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ ignite/distributed/comp_models/native.py:165: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ ignite/metrics/gan/utils.py:31: error: Incompatible types in assignment (expression has type "Dict[str, bool]", variable has type "Dict[LiteralString, bool]")  [assignment]
- ignite/handlers/time_profilers.py:258: error: Unused "type: ignore" comment
+ ignite/handlers/time_profilers.py:746: error: Incompatible types in assignment (expression has type "str", target has type "LiteralString")  [assignment]
+ ignite/handlers/time_profilers.py:747: error: Incompatible types in assignment (expression has type "str", target has type "LiteralString")  [assignment]
+ ignite/handlers/checkpoint.py:427: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ ignite/handlers/checkpoint.py:521: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ ignite/handlers/checkpoint.py:524: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ ignite/handlers/checkpoint.py:526: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ ignite/handlers/checkpoint.py:531: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ ignite/handlers/checkpoint.py:533: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ ignite/handlers/checkpoint.py:688: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ ignite/handlers/checkpoint.py:689: error: Incompatible types in assignment (expression has type "Union[Any, str]", variable has type "LiteralString")  [assignment]

vision (https://github.com/pytorch/vision)
+ torchvision/models/segmentation/_utils.py:37: error: Incompatible return value type (got "OrderedDict[LiteralString, Any]", expected "Dict[str, Any]")  [return-value]
+ torchvision/io/_video_opt.py:484: error: Incompatible return value type (got "Tuple[Any, Any, Dict[LiteralString, float]]", expected "Tuple[Any, Any, Dict[str, float]]")  [return-value]
+ torchvision/datasets/utils.py:472: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ torchvision/datasets/utils.py:480: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ torchvision/datasets/utils.py:483: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ torchvision/datasets/mnist.py:298: error: Incompatible types in assignment (expression has type "object", variable has type "List[str]")  [assignment]
+ torchvision/datasets/_stereo_matching.py:524: error: "object" has no attribute "__iter__"; maybe "__str__" or "__dir__"? (not iterable)  [attr-defined]
+ torchvision/models/swin_transformer.py:653: error: Argument 1 to "update" of "MutableMapping" has incompatible type "Dict[LiteralString, List[str]]"; expected "SupportsKeysAndGetItem[str, Any]"  [arg-type]
+ torchvision/models/swin_transformer.py:676: error: Argument 1 to "update" of "MutableMapping" has incompatible type "Dict[LiteralString, List[str]]"; expected "SupportsKeysAndGetItem[str, Any]"  [arg-type]
+ torchvision/models/swin_transformer.py:699: error: Argument 1 to "update" of "MutableMapping" has incompatible type "Dict[LiteralString, List[str]]"; expected "SupportsKeysAndGetItem[str, Any]"  [arg-type]
+ torchvision/models/swin_transformer.py:722: error: Argument 1 to "update" of "MutableMapping" has incompatible type "Dict[LiteralString, List[str]]"; expected "SupportsKeysAndGetItem[str, Any]"  [arg-type]
+ torchvision/models/swin_transformer.py:745: error: Argument 1 to "update" of "MutableMapping" has incompatible type "Dict[LiteralString, List[str]]"; expected "SupportsKeysAndGetItem[str, Any]"  [arg-type]
+ torchvision/models/swin_transformer.py:768: error: Argument 1 to "update" of "MutableMapping" has incompatible type "Dict[LiteralString, List[str]]"; expected "SupportsKeysAndGetItem[str, Any]"  [arg-type]
+ torchvision/models/segmentation/lraspp.py:51: error: Incompatible return value type (got "OrderedDict[LiteralString, Any]", expected "Dict[str, Any]")  [return-value]
+ torchvision/datasets/kinetics.py:132: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ torchvision/models/optical_flow/raft.py:540: error: Argument 1 to "update" of "MutableMapping" has incompatible type "Dict[LiteralString, Tuple[int, int]]"; expected "SupportsKeysAndGetItem[str, Any]"  [arg-type]
+ torchvision/models/optical_flow/raft.py:558: error: Argument 1 to "update" of "MutableMapping" has incompatible type "Dict[LiteralString, Tuple[int, int]]"; expected "SupportsKeysAndGetItem[str, Any]"  [arg-type]
+ torchvision/models/optical_flow/raft.py:577: error: Argument 1 to "update" of "MutableMapping" has incompatible type "Dict[LiteralString, Tuple[int, int]]"; expected "SupportsKeysAndGetItem[str, Any]"  [arg-type]
+ torchvision/models/optical_flow/raft.py:601: error: Argument 1 to "update" of "MutableMapping" has incompatible type "Dict[LiteralString, Tuple[int, int]]"; expected "SupportsKeysAndGetItem[str, Any]"  [arg-type]
+ torchvision/models/optical_flow/raft.py:626: error: Argument 1 to "update" of "MutableMapping" has incompatible type "Dict[LiteralString, Tuple[int, int]]"; expected "SupportsKeysAndGetItem[str, Any]"  [arg-type]
+ torchvision/models/optical_flow/raft.py:647: error: Argument 1 to "update" of "MutableMapping" has incompatible type "Dict[LiteralString, Tuple[int, int]]"; expected "SupportsKeysAndGetItem[str, Any]"  [arg-type]
+ torchvision/models/optical_flow/raft.py:686: error: Argument 1 to "update" of "MutableMapping" has incompatible type "Dict[LiteralString, Tuple[int, int]]"; expected "SupportsKeysAndGetItem[str, Any]"  [arg-type]
+ torchvision/models/optical_flow/raft.py:703: error: Argument 1 to "update" of "MutableMapping" has incompatible type "Dict[LiteralString, Tuple[int, int]]"; expected "SupportsKeysAndGetItem[str, Any]"  [arg-type]
+ torchvision/prototype/transforms/functional/_deprecated.py:15: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ torchvision/prototype/datasets/_builtin/voc.py:73: error: Value of type "object" is not indexable  [index]

rclip (https://github.com/yurijmikhalevich/rclip)
+ rclip/db.py:70: error: Argument 2 to "execute" of "Connection" has incompatible type "Dict[LiteralString, None]"; expected "Union[SupportsLenAndGetItem[Union[Union[str, Union[bytes, Union[bytearray, memoryview, array[Any], mmap, _CData, PickleBuffer]], int, float, None], Any]], Mapping[str, Union[Union[str, Union[bytes, Union[bytearray, memoryview, array[Any], mmap, _CData, PickleBuffer]], int, float, None], Any]]]"
+ rclip/db.py:70: note: Following member(s) of "Dict[LiteralString, None]" have conflicts:
+ rclip/db.py:70: note:     Expected:
+ rclip/db.py:70: note:         def __getitem__(self, int, /) -> Union[Union[str, Union[bytes, Union[bytearray, memoryview, array[Any], mmap, _CData, PickleBuffer]], int, float, None], Any]
+ rclip/db.py:70: note:     Got:
+ rclip/db.py:70: note:         def __getitem__(self, LiteralString, /) -> None
- rclip/db.py:70: error: Argument 1 to "update" of "MutableMapping" has incompatible type "NewImage"; expected "SupportsKeysAndGetItem[str, None]"
+ rclip/db.py:70: error: Argument 1 to "update" of "MutableMapping" has incompatible type "NewImage"; expected "SupportsKeysAndGetItem[LiteralString, None]"
- rclip/db.py:70: note:         def __getitem__(self, str, /) -> None
+ rclip/db.py:70: note:         def __getitem__(self, LiteralString, /) -> None
+ rclip/db.py:70: note:     Expected:
+ rclip/db.py:70: note:         def keys(self) -> Iterable[LiteralString]
+ rclip/db.py:70: note:     Got:
+ rclip/db.py:70: note:         def keys(self) -> dict_keys[str, object]

aiortc (https://github.com/aiortc/aiortc)
+ src/aiortc/rtcdatachannel.py:203: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")
+ src/aiortc/rtcicetransport.py:230: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")
+ src/aiortc/rtcicetransport.py:358: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")
+ src/aiortc/rtcdtlstransport.py:677: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")
+ src/aiortc/sdp.py:395: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")
+ src/aiortc/sdp.py:399: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")
+ src/aiortc/rtcpeerconnection.py:1147: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")

git-revise (https://github.com/mystor/git-revise)
+ gitrevise/utils.py:230: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")

mkosi (https://github.com/systemd/mkosi)
+ mkosi/manifest.py:67:24: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ mkosi/manifest.py:69:27: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ mkosi/manifest.py:71:24: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ mkosi/manifest.py:73:24: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ mkosi/__init__.py:2049:26: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ mkosi/__init__.py:2188:25: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ mkosi/__init__.py:2764:9: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ mkosi/__init__.py:3953:30: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ mkosi/__init__.py:6228:19: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ mkosi/__init__.py:6230:19: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ mkosi/__init__.py:6952:45: error: Argument "env" to "run" has incompatible type "Dict[LiteralString, Path]"; expected "Mapping[str, Any]"  [arg-type]
+ mkosi/__init__.py:7610:21: error: "object" has no attribute "__iter__"; maybe "__str__" or "__dir__"? (not iterable)  [attr-defined]
+ mkosi/__init__.py:7625:21: error: "object" has no attribute "__iter__"; maybe "__str__" or "__dir__"? (not iterable)  [attr-defined]
+ mkosi/__init__.py:7978:27: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ mkosi/__init__.py:7983:27: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ mkosi/gentoo.py:457:9: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]

optuna (https://github.com/optuna/optuna)
+ tests/integration_tests/lightgbm_tuner_tests/test_alias.py:12: error: Argument 1 to "_handling_alias_parameters" has incompatible type "Dict[LiteralString, float]"; expected "Dict[str, Any]"
+ tests/integration_tests/lightgbm_tuner_tests/test_alias.py:90: error: Argument 1 to "_handling_alias_metrics" has incompatible type "Dict[LiteralString, str]"; expected "Dict[str, Any]"
+ tests/integration_tests/lightgbm_tuner_tests/test_alias.py:94: error: Argument 1 to "_handling_alias_metrics" has incompatible type "Dict[LiteralString, str]"; expected "Dict[str, Any]"
+ benchmarks/bayesmark/report_bayesmark.py:214: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")
+ optuna/integration/__init__.py:37: error: No overload variant of "__add__" of "list" matches argument type "object"
+ optuna/integration/__init__.py:37: note: Possible overload variants:
+ optuna/integration/__init__.py:37: note:     def __add__(self, List[str], /) -> List[str]
+ optuna/integration/__init__.py:37: note:     def [_S] __add__(self, List[_S], /) -> List[Union[_S, str]]
+ optuna/integration/__init__.py:37: error: Value of type variable "_AddableT1" of "sum" cannot be "object"
+ optuna/samplers/_qmc.py:308: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")
+ optuna/samplers/_qmc.py:311: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")
+ optuna/samplers/_qmc.py:313: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")
+ optuna/samplers/_grid.py:180: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")
+ optuna/samplers/_cmaes.py:339: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")
+ optuna/samplers/_cmaes.py:370: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")
+ optuna/integration/catboost.py:66: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")
+ optuna/integration/catboost.py:104: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")
+ optuna/integration/lightgbm.py:113: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")
+ tests/trial_tests/test_fixed.py:7: error: Argument 1 to "FixedTrial" has incompatible type "Dict[LiteralString, int]"; expected "Dict[str, Any]"
+ tests/trial_tests/test_fixed.py:17: error: Argument 1 to "FixedTrial" has incompatible type "Dict[LiteralString, int]"; expected "Dict[str, Any]"
+ tests/trial_tests/test_fixed.py:20: error: Argument 1 to "FixedTrial" has incompatible type "Dict[LiteralString, int]"; expected "Dict[str, Any]"
+ tests/integration_tests/test_sklearn.py:57: error: Argument 2 to "OptunaSearchCV" has incompatible type "Dict[LiteralString, FloatDistribution]"; expected "Mapping[str, BaseDistribution]"
+ tests/integration_tests/test_sklearn.py:88: error: Argument 2 to "OptunaSearchCV" has incompatible type "Dict[LiteralString, FloatDistribution]"; expected "Mapping[str, BaseDistribution]"
+ tests/integration_tests/test_sklearn.py:364: error: Argument 2 to "OptunaSearchCV" has incompatible type "Dict[LiteralString, FloatDistribution]"; expected "Mapping[str, BaseDistribution]"
+ tests/integration_tests/test_mlflow.py:197: error: Argument "mlflow_kwargs" to "MLflowCallback" has incompatible type "Dict[LiteralString, Optional[str]]"; expected "Optional[Dict[str, Any]]"
+ tests/integration_tests/test_mlflow.py:362: error: Argument "mlflow_kwargs" to "MLflowCallback" has incompatible type "Dict[LiteralString, Dict[str, int]]"; expected "Optional[Dict[str, Any]]"
+ optuna/cli.py:179: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")
+ optuna/cli.py:181: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")
+ optuna/cli.py:183: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")
+ optuna/cli.py:185: error: Incompatible types in assignment (expression has type "str", target has type "LiteralString")
+ optuna/cli.py:188: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")
+ optuna/cli.py:189: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")
+ optuna/cli.py:190: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")
+ optuna/cli.py:191: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")
+ optuna/cli.py:192: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")
+ optuna/cli.py:826: error: Argument 1 to "append" of "list" has incompatible type "Tuple[LiteralString, str]"; expected "Tuple[LiteralString, LiteralString]"
+ optuna/visualization/_pareto_front.py:428: error: No overload variant of "update" of "MutableMapping" matches argument type "object"
+ optuna/visualization/_pareto_front.py:428: note: Possible overload variants:
+ optuna/visualization/_pareto_front.py:428: note:     def update(self, SupportsKeysAndGetItem[Any, Any], /, **kwargs: Any) -> None
+ optuna/visualization/_pareto_front.py:428: note:     def update(self, Iterable[Tuple[Any, Any]], /, **kwargs: Any) -> None
+ optuna/visualization/_pareto_front.py:428: note:     def update(self, **kwargs: Any) -> None
+ tests/test_cli.py:122: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")
+ tests/test_cli.py:892: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")
+ tests/test_cli.py:913: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")
+ tests/trial_tests/test_frozen.py:213: error: Argument 1 to "dict" has incompatible type "Dict[LiteralString, FloatDistribution]"; expected "SupportsKeysAndGetItem[str, BaseDistribution]"
+ tests/trial_tests/test_frozen.py:217: error: Incompatible types in assignment (expression has type "Dict[str, FloatDistribution]", variable has type "Dict[LiteralString, FloatDistribution]")
+ tests/trial_tests/test_frozen.py:218: error: Argument 1 to "dict" has incompatible type "Dict[LiteralString, FloatDistribution]"; expected "SupportsKeysAndGetItem[str, BaseDistribution]"

sphinx (https://github.com/sphinx-doc/sphinx)
+ sphinx/util/images.py: note: In function "parse_data_uri":
+ sphinx/util/images.py:90:23: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ sphinx/util/images.py:92:24: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ sphinx/util/smartypants.py: note: In function "educate_tokens":
+ sphinx/util/smartypants.py:332:36: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ sphinx/util/smartypants.py:370:32: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ sphinx/util/matching.py: note: In function "_translate_pattern":
+ sphinx/util/matching.py:25:23: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ sphinx/util/matching.py:28:23: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ sphinx/util/matching.py:31:19: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ sphinx/util/matching.py:41:23: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ sphinx/util/matching.py:50:23: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ sphinx/util/matching.py:52:13: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ sphinx/util/typing.py: note: In function "_stringify_py37":
+ sphinx/util/typing.py:412:25: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ sphinx/util/typing.py:414:25: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ sphinx/util/typing.py:417:25: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ sphinx/util/typing.py:419:25: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ sphinx/util/typing.py:488:25: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ sphinx/util/typing.py:490:25: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ sphinx/util/typing.py:493:25: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ sphinx/util/typing.py:495:25: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ sphinx/util/inspect.py: note: In function "stringify_signature":
+ sphinx/util/inspect.py:719:21: error: Argument 1 to "append" of "list" has incompatible type "str"; expected "LiteralString"  [arg-type]
+ sphinx/util/inspect.py: note: At top level:
+ sphinx/util/__init__.py: note: In function "save_traceback":
+ sphinx/util/__init__.py:231:21: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ sphinx/roles.py: note: In member "run" of class "XRefRole":
+ sphinx/roles.py:98:44: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ sphinx/roles.py: note: In member "parse" of class "EmphasizedLiteral":
+ sphinx/roles.py:288:17: error: Incompatible types in assignment (expression has type "str", target has type "LiteralString")  [assignment]
+ sphinx/roles.py:291:21: error: Incompatible types in assignment (expression has type "str", target has type "LiteralString")  [assignment]
+ sphinx/roles.py:308:17: error: Incompatible types in assignment (expression has type "str", target has type "LiteralString")  [assignment]
+ sphinx/roles.py:310:17: error: Incompatible types in assignment (expression has type "str", target has type "LiteralString")  [assignment]
+ sphinx/roles.py:312:17: error: Incompatible types in assignment (expression has type "str", target has type "LiteralString")  [assignment]
+ sphinx/domains/__init__.py: note: In member "__init__" of class "ObjType":
+ sphinx/domains/__init__.py:50:27: error: Argument 1 to "update" of "MutableMapping" has incompatible type "Dict[str, Any]"; expected "SupportsKeysAndGetItem[LiteralString, int]"  [arg-type]
+ sphinx/search/__init__.py: note: In member "get_objects" of class "IndexBuilder":
+ sphinx/search/__init__.py:351:35: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ sphinx/domains/std.py: note: In member "run" of class "Target":
+ sphinx/domains/std.py:139:29: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ sphinx/domains/std.py: note: In member "handle_signature" of class "Cmdoption":
+ sphinx/domains/std.py:215:29: error: Incompatible types in assignment (expression has type "Union[str, Any]", variable has type "LiteralString")  [assignment]
+ sphinx/domains/std.py: note: In member "run" of class "ProductionList":
+ sphinx/domains/std.py:499:35: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ sphinx/transforms/i18n.py: note: In member "apply" of class "Locale":
+ sphinx/transforms/i18n.py:122:22: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ sphinx/transforms/i18n.py:129:29: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ sphinx/transforms/i18n.py:141:17: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ sphinx/transforms/i18n.py:147:26: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ sphinx/transforms/i18n.py:240:22: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ sphinx/transforms/i18n.py:245:32: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ sphinx/transforms/i18n.py:275:17: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ sphinx/transforms/i18n.py:281:26: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ sphinx/transforms/i18n.py:288:26: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ sphinx/transforms/i18n.py:484:34: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ sphinx/transforms/i18n.py:486:38: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ sphinx/io.py: note: In function "create_publisher":
+ sphinx/io.py:214:38: error: Argument 1 to "update" of "MutableMapping" has incompatible type "Dict[str, Any]"; expected "SupportsKeysAndGetItem[LiteralString, bool]"  [arg-type]
+ sphinx/io.py:217:9: error: Keywords must be strings  [misc]
+ sphinx/io.py:217:9: note: Error code "misc" not covered by "type: ignore" comment
+ sphinx/registry.py: note: In member "load_extension" of class "SphinxComponentRegistry":
+ sphinx/registry.py:452:57: error: Invalid index type "str" for "Dict[LiteralString, LiteralString]"; expected type "LiteralString"  [index]
+ sphinx/ext/autodoc/__init__.py: note: In member "format_args" of class "MethodDocumenter":
+ sphinx/ext/autodoc/__init__.py:2161:24: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ sphinx/ext/autodoc/__init__.py:2171:20: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ sphinx/writers/html5.py: note: In member "visit_desc_parameterlist" of class "HTML5Translator":
+ sphinx/writers/html5.py:159:32: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ sphinx/writers/html5.py: note: In member "visit_reference" of class "HTML5Translator":
+ sphinx/writers/html5.py:212:13: error: Incompatible types in assignment (expression has type "str", target has type "LiteralString")  [assignment]
+ sphinx/writers/html5.py:214:13: error: Incompatible types in assignment (expression has type "str", target has type "LiteralString")  [assignment]
+ sphinx/writers/html5.py:218:32: error: Incompatible types in assignment (expression has type "str", target has type "LiteralString")  [assignment]
+ sphinx/writers/html5.py:226:13: error: Incompatible types in assignment (expression has type "str", target has type "LiteralString")  [assignment]
+ sphinx/writers/html5.py:231:26: error: Keywords must be strings  [misc]
+ sphinx/writers/html.py: note: In member "visit_desc_parameterlist" of class "HTMLTranslator":
+ sphinx/writers/html.py:180:32: error: Incompatible types in assignment (expression has type "str", variable has type "LiteralString")  [assignment]
+ sphinx/writers/html.py: note: In member "visit_reference" of class "HTMLTranslator":
+ sphinx/writers/html.py:233:13: error: Incompatible types in assignment (expression has type "str", target has type "LiteralString")  [assignment]
+ sphinx/writers/html.py:235:13: error: Incompatible types in assignment (expression has type "str", target has type "LiteralString")  [assignment]
+ sphinx/writers/html.py:239:32: error: Incompatible types in assignment (expression has type "str", target has type "LiteralString")  [assignment]
+ sphinx/writers/html.py:247:13: error: Incompatible types in assignment (expression has type "str", target has type "LiteralString")  [assignment]
+ sphinx/writers/html.py:252:26: error: Keywords must be strings  [misc]
+ sphinx/util/cfamily.py: note: In member "_stringify" of class "ASTGnuAttributeList":
+ sphinx/util/cfamily.py:158:24: error: Argument 1 to "append" of "list" has incompatible type "str"; expected "LiteralString"  [arg-type]
+ sphinx/environment/adapters/indexentries.py: note: In member "create_index" of class "IndexEntries":
+ sphinx/environment/adapters/indexentries.py:136:34: error: Incompatible types in assignment (expression has type "Union[str, Any]", variable has type "LiteralString")  [assignment]
+ sphinx/environment/adapters/indexentries.py:138:34: error: Incompatible types in assignment (expressio

... (truncated 3432 lines) ...

github-actions[bot] avatar Sep 14 '22 10:09 github-actions[bot]

Diff from mypy_primer, showing the effect of this PR on open source code:

rclip (https://github.com/yurijmikhalevich/rclip)
- rclip/db.py:70: error: Argument 1 to "update" of "MutableMapping" has incompatible type "NewImage"; expected "SupportsKeysAndGetItem[str, None]"
+ rclip/db.py:70: error: Argument 1 to "update" of "MutableMapping" has incompatible type "NewImage"; expected "SupportsKeysAndGetItem[LiteralString, None]"
- rclip/db.py:70: note:         def __getitem__(self, str, /) -> None
+ rclip/db.py:70: note:         def __getitem__(self, LiteralString, /) -> None

apprise (https://github.com/caronc/apprise)
- apprise/cli.py:88: error: Incompatible types in assignment (expression has type "Tuple[str, str, str, str]", variable has type "Tuple[str, str, str, str, str, str, str, str]")
+ apprise/cli.py:88: error: Incompatible types in assignment (expression has type "Tuple[str, str, str, str]", variable has type "Tuple[LiteralString, LiteralString, LiteralString, LiteralString, LiteralString, LiteralString, LiteralString, LiteralString]")

operator (https://github.com/canonical/operator)
- ops/model.py:1149: error: Incompatible types in assignment (expression has type "str", base class "StatusBase" defined the type as "_NotImplementedType")
+ ops/model.py:1149: error: Incompatible types in assignment (expression has type "LiteralString", base class "StatusBase" defined the type as "_NotImplementedType")
- ops/model.py:1165: error: Incompatible types in assignment (expression has type "str", base class "StatusBase" defined the type as "_NotImplementedType")
+ ops/model.py:1165: error: Incompatible types in assignment (expression has type "LiteralString", base class "StatusBase" defined the type as "_NotImplementedType")
- ops/model.py:1177: error: Incompatible types in assignment (expression has type "str", base class "StatusBase" defined the type as "_NotImplementedType")
+ ops/model.py:1177: error: Incompatible types in assignment (expression has type "LiteralString", base class "StatusBase" defined the type as "_NotImplementedType")
- ops/model.py:1189: error: Incompatible types in assignment (expression has type "str", base class "StatusBase" defined the type as "_NotImplementedType")
+ ops/model.py:1189: error: Incompatible types in assignment (expression has type "LiteralString", base class "StatusBase" defined the type as "_NotImplementedType")
- ops/model.py:1200: error: Incompatible types in assignment (expression has type "str", base class "StatusBase" defined the type as "_NotImplementedType")
+ ops/model.py:1200: error: Incompatible types in assignment (expression has type "LiteralString", base class "StatusBase" defined the type as "_NotImplementedType")
- ops/testing.py:129: error: Argument 2 to "Framework" has incompatible type "str"; expected "Path"
+ ops/testing.py:129: error: Argument 2 to "Framework" has incompatible type "LiteralString"; expected "Path"
- ops/testing.py:394: error: Incompatible types in assignment (expression has type "Path", variable has type "str")
+ ops/testing.py:394: error: Incompatible types in assignment (expression has type "Path", variable has type "LiteralString")
- ops/testing.py:397: error: Incompatible types in assignment (expression has type "str", variable has type "Optional[Dict[Any, Any]]")
+ ops/testing.py:397: error: Incompatible types in assignment (expression has type "LiteralString", variable has type "Optional[Dict[Any, Any]]")

psycopg (https://github.com/psycopg/psycopg)
+ psycopg/psycopg/abc.py:28: error: "LiteralString" is not fully supported yet, use --enable-incomplete-features  [misc]
+ psycopg/psycopg/sql.py:146: error: "LiteralString" is not fully supported yet, use --enable-incomplete-features  [misc]
+ psycopg/psycopg/sql.py:194: error: "LiteralString" is not fully supported yet, use --enable-incomplete-features  [misc]
+ psycopg/psycopg/sql.py:197: error: "LiteralString" is not fully supported yet, use --enable-incomplete-features  [misc]
+ psycopg/psycopg/sql.py:250: error: "LiteralString" is not fully supported yet, use --enable-incomplete-features  [misc]
+ psycopg/psycopg/connection.py:611: error: "LiteralString" is not fully supported yet, use --enable-incomplete-features  [misc]

pyppeteer (https://github.com/pyppeteer/pyppeteer)
- pyppeteer/launcher.py:149: error: Argument 2 to "Popen" has incompatible type "**Dict[str, Optional[Any]]"; expected "int"
+ pyppeteer/launcher.py:149: error: Argument 2 to "Popen" has incompatible type "**Dict[LiteralString, Optional[Any]]"; expected "int"
- pyppeteer/launcher.py:149: error: Argument 2 to "Popen" has incompatible type "**Dict[str, Optional[Any]]"; expected "bool"
+ pyppeteer/launcher.py:149: error: Argument 2 to "Popen" has incompatible type "**Dict[LiteralString, Optional[Any]]"; expected "bool"
- pyppeteer/launcher.py:149: error: Argument 2 to "Popen" has incompatible type "**Dict[str, Optional[Any]]"; expected "str"
+ pyppeteer/launcher.py:149: error: Argument 2 to "Popen" has incompatible type "**Dict[LiteralString, Optional[Any]]"; expected "str"

discord.py (https://github.com/Rapptz/discord.py)
- discord/mentions.py:136: error: Incompatible types in assignment (expression has type "List[str]", target has type "List[Union[Any, int]]")
+ discord/mentions.py:136: error: Incompatible types in assignment (expression has type "List[LiteralString]", target has type "List[Union[Any, int]]")
- discord/scheduled_event.py:461: error: Incompatible types in assignment (expression has type "Dict[str, str]", target has type "str")
+ discord/scheduled_event.py:461: error: Incompatible types in assignment (expression has type "Dict[LiteralString, str]", target has type "str")
- discord/http.py:226: error: No overload variant of "__setitem__" of "list" matches argument types "str", "bool"
+ discord/http.py:226: error: No overload variant of "__setitem__" of "list" matches argument types "LiteralString", "bool"
- discord/http.py:247: error: Dict entry 0 has incompatible type "str": "Dict[str, List[Embed]]"; expected "str": "List[Embed]"
+ discord/http.py:247: error: Dict entry 0 has incompatible type "LiteralString": "Dict[LiteralString, List[Embed]]"; expected "LiteralString": "List[Embed]"
- discord/http.py:254: error: Incompatible types in assignment (expression has type "None", variable has type "Dict[str, List[Embed]]")
+ discord/http.py:254: error: Incompatible types in assignment (expression has type "None", variable has type "Dict[LiteralString, List[Embed]]")
- discord/http.py:259: error: Dict entry 1 has incompatible type "str": "BufferedIOBase"; expected "str": "str"
+ discord/http.py:259: error: Dict entry 1 has incompatible type "LiteralString": "BufferedIOBase"; expected "str": "str"
- discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, BasicAuth, None, str]]"; expected "str"
+ discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[LiteralString, str], float, BasicAuth, None, str]]"; expected "str"
- discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, BasicAuth, None, str]]"; expected "Iterable[str]"
+ discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[LiteralString, str], float, BasicAuth, None, str]]"; expected "Iterable[str]"
- discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, BasicAuth, None, str]]"; expected "float"
+ discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[LiteralString, str], float, BasicAuth, None, str]]"; expected "float"
- discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, BasicAuth, None, str]]"; expected "Optional[float]"
+ discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[LiteralString, str], float, BasicAuth, None, str]]"; expected "Optional[float]"
- discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, BasicAuth, None, str]]"; expected "bool"
+ discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[LiteralString, str], float, BasicAuth, None, str]]"; expected "bool"
- discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, BasicAuth, None, str]]"; expected "Optional[BasicAuth]"
+ discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[LiteralString, str], float, BasicAuth, None, str]]"; expected "Optional[BasicAuth]"
- discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, BasicAuth, None, str]]"; expected "Optional[str]"
+ discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[LiteralString, str], float, BasicAuth, None, str]]"; expected "Optional[str]"
- discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, BasicAuth, None, str]]"; expected "Optional[Mapping[str, str]]"
+ discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[LiteralString, str], float, BasicAuth, None, str]]"; expected "Optional[Mapping[str, str]]"
- discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, BasicAuth, None, str]]"; expected "Union[Mapping[Union[str, istr], str], CIMultiDict[str], CIMultiDictProxy[str], None]"
+ discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[LiteralString, str], float, BasicAuth, None, str]]"; expected "Union[Mapping[Union[str, istr], str], CIMultiDict[str], CIMultiDictProxy[str], None]"
- discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, BasicAuth, None, str]]"; expected "Union[str, URL, None]"
+ discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[LiteralString, str], float, BasicAuth, None, str]]"; expected "Union[str, URL, None]"
- discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, BasicAuth, None, str]]"; expected "Union[SSLContext, bool, Fingerprint, None]"
+ discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[LiteralString, str], float, BasicAuth, None, str]]"; expected "Union[SSLContext, bool, Fingerprint, None]"
- discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, BasicAuth, None, str]]"; expected "Optional[bool]"
+ discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[LiteralString, str], float, BasicAuth, None, str]]"; expected "Optional[bool]"
- discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, BasicAuth, None, str]]"; expected "Optional[bytes]"
+ discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[LiteralString, str], float, BasicAuth, None, str]]"; expected "Optional[bytes]"
- discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, BasicAuth, None, str]]"; expected "Optional[SSLContext]"
+ discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[LiteralString, str], float, BasicAuth, None, str]]"; expected "Optional[SSLContext]"
- discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, BasicAuth, None, str]]"; expected "int"
+ discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[LiteralString, str], float, BasicAuth, None, str]]"; expected "int"
- discord/guild.py:2952: error: Incompatible types in assignment (expression has type "Dict[str, str]", target has type "str")
+ discord/guild.py:2952: error: Incompatible types in assignment (expression has type "Dict[LiteralString, str]", target has type "str")
- discord/webhook/async_.py:618: error: Dict entry 1 has incompatible type "str": "BufferedIOBase"; expected "str": "str"
+ discord/webhook/async_.py:618: error: Dict entry 1 has incompatible type "LiteralString": "BufferedIOBase"; expected "str": "str"
- discord/app_commands/tree.py:887: error: Incompatible types in assignment (expression has type "Union[str, locale_str]", variable has type "str")
+ discord/app_commands/tree.py:887: error: Incompatible types in assignment (expression has type "Union[str, locale_str]", variable has type "LiteralString")
- discord/app_commands/commands.py:1947: error: Incompatible types in assignment (expression has type "Union[str, locale_str]", variable has type "str")
+ discord/app_commands/commands.py:1947: error: Incompatible types in assignment (expression has type "Union[str, locale_str]", variable has type "LiteralString")
- discord/app_commands/commands.py:2008: error: Incompatible types in assignment (expression has type "Union[str, locale_str]", variable has type "str")
+ discord/app_commands/commands.py:2008: error: Incompatible types in assignment (expression has type "Union[str, locale_str]", variable has type "LiteralString")

prefect (https://github.com/PrefectHQ/prefect)
- src/prefect/filesystems.py:791: error: Argument 1 to "run_process" has incompatible type "str"; expected "List[str]"
+ src/prefect/filesystems.py:791: error: Argument 1 to "run_process" has incompatible type "LiteralString"; expected "List[str]"
- src/prefect/orion/database/configurations.py:214: error: Incompatible types in assignment (expression has type "str", target has type "Dict[str, Union[float, Any]]")
+ src/prefect/orion/database/configurations.py:214: error: Incompatible types in assignment (expression has type "LiteralString", target has type "Dict[LiteralString, Union[float, Any]]")
- src/prefect/infrastructure/kubernetes.py:302: error: Dict entry 2 has incompatible type "str": "Dict[str, Any]"; expected "str": "str"
+ src/prefect/infrastructure/kubernetes.py:302: error: Dict entry 2 has incompatible type "LiteralString": "Dict[str, Any]"; expected "str": "str"
- src/prefect/infrastructure/kubernetes.py:330: error: Dict entry 2 has incompatible type "str": "int"; expected "str": "str"
+ src/prefect/infrastructure/kubernetes.py:330: error: Dict entry 2 has incompatible type "LiteralString": "int"; expected "str": "str"
- src/prefect/infrastructure/kubernetes.py:339: error: Dict entry 2 has incompatible type "str": "List[str]"; expected "str": "str"
+ src/prefect/infrastructure/kubernetes.py:339: error: Dict entry 2 has incompatible type "LiteralString": "List[str]"; expected "str": "str"
+ src/prefect/engine.py:597: error: Incompatible types in assignment (expression has type "Literal[True]", variable has type "bool")
- src/prefect/cli/flow_run.py:63: error: Dict entry 0 has incompatible type "str": "List[StateType]"; expected "str": "List[str]"
+ src/prefect/cli/flow_run.py:63: error: Dict entry 0 has incompatible type "LiteralString": "List[StateType]"; expected "LiteralString": "List[str]"

mypy (https://github.com/python/mypy)
+ mypy/checker.py:1775: error: Incompatible types in assignment (expression has type "Literal[False]", variable has type "Union[Literal[True], bool]")  [assignment]

streamlit (https://github.com/streamlit/streamlit)
- lib/tests/streamlit/type_util_test.py:92:22: error: Argument 1 to "to_bytes" has incompatible type "str"; expected "Union[bytes, bytearray]"  [arg-type]
+ lib/tests/streamlit/type_util_test.py:92:22: error: Argument 1 to "to_bytes" has incompatible type "LiteralString"; expected "Union[bytes, bytearray]"  [arg-type]
- lib/tests/streamlit/runtime/legacy_caching/hashing_test.py:257:30: error: Unsupported operand types for + ("str" and "int")  [operator]
+ lib/tests/streamlit/runtime/legacy_caching/hashing_test.py:257:30: error: Unsupported operand types for + ("LiteralString" and "int")  [operator]
- lib/tests/streamlit/runtime/legacy_caching/hashing_test.py:335:33: error: Argument 1 to "UploadedFileRec" has incompatible type "str"; expected "int"  [arg-type]
+ lib/tests/streamlit/runtime/legacy_caching/hashing_test.py:335:33: error: Argument 1 to "UploadedFileRec" has incompatible type "LiteralString"; expected "int"  [arg-type]
- lib/tests/streamlit/runtime/legacy_caching/hashing_test.py:336:33: error: Argument 1 to "UploadedFileRec" has incompatible type "str"; expected "int"  [arg-type]
+ lib/tests/streamlit/runtime/legacy_caching/hashing_test.py:336:33: error: Argument 1 to "UploadedFileRec" has incompatible type "LiteralString"; expected "int"  [arg-type]
- lib/tests/streamlit/runtime/legacy_caching/hashing_test.py:337:33: error: Argument 1 to "UploadedFileRec" has incompatible type "str"; expected "int"  [arg-type]
+ lib/tests/streamlit/runtime/legacy_caching/hashing_test.py:337:33: error: Argument 1 to "UploadedFileRec" has incompatible type "LiteralString"; expected "int"  [arg-type]
- lib/tests/streamlit/delta_generator_test.py:514:25: error: Argument 1 has incompatible type "str"; expected "Union[int, float]"  [arg-type]
+ lib/tests/streamlit/delta_generator_test.py:514:25: error: Argument 1 has incompatible type "LiteralString"; expected "Union[int, float]"  [arg-type]
- lib/tests/streamlit/runtime/legacy_caching/caching_test.py:194:54: error: List item 0 has incompatible type "str"; expected "Callable[..., Any]"  [list-item]
+ lib/tests/streamlit/runtime/legacy_caching/caching_test.py:194:54: error: List item 0 has incompatible type "LiteralString"; expected "Callable[..., Any]"  [list-item]
- lib/tests/streamlit/elements/selectbox_test.py:131:51: error: Argument 3 has incompatible type "str"; expected "int"  [arg-type]
+ lib/tests/streamlit/elements/selectbox_test.py:131:51: error: Argument 3 has incompatible type "LiteralString"; expected "int"  [arg-type]
- lib/tests/streamlit/elements/radio_test.py:145:47: error: Argument 3 has incompatible type "str"; expected "int"  [arg-type]
+ lib/tests/streamlit/elements/radio_test.py:145:47: error: Argument 3 has incompatible type "LiteralString"; expected "int"  [arg-type]
- lib/tests/streamlit/elements/file_uploader_test.py:75:26: error: No overload variant matches argument types "str", "str", "bool"  [call-overload]
+ lib/tests/streamlit/elements/file_uploader_test.py:75:26: error: No overload variant matches argument types "LiteralString", "LiteralString", "bool"  [call-overload]
- lib/tests/streamlit/elements/file_uploader_test.py:190:13: error: No overload variant matches argument types "str", "str"  [call-overload]
+ lib/tests/streamlit/elements/file_uploader_test.py:190:13: error: No overload variant matches argument types "LiteralString", "LiteralString"  [call-overload]
- lib/tests/streamlit/commands/page_config_test.py:110:39: error: Argument "menu_items" to "set_page_config" has incompatible type "Dict[str, str]"; expected "Optional[Mapping[Literal['Get help', 'Get Help', 'get help', 'Report a bug', 'report a bug', 'About', 'about'], Optional[str]]]"  [arg-type]
+ lib/tests/streamlit/commands/page_config_test.py:110:39: error: Argument "menu_items" to "set_page_config" has incompatible type "Dict[LiteralString, LiteralString]"; expected "Optional[Mapping[Literal['Get help', 'Get Help', 'get help', 'Report a bug', 'report a bug', 'About', 'about'], Optional[str]]]"  [arg-type]
- lib/tests/streamlit/commands/page_config_test.py:146:43: error: Argument "menu_items" to "set_page_config" has incompatible type "Dict[str, str]"; expected "Optional[Mapping[Literal['Get help', 'Get Help', 'get help', 'Report a bug', 'report a bug', 'About', 'about'], Optional[str]]]"  [arg-type]
+ lib/tests/streamlit/commands/page_config_test.py:146:43: error: Argument "menu_items" to "set_page_config" has incompatible type "Dict[LiteralString, LiteralString]"; expected "Optional[Mapping[Literal['Get help', 'Get Help', 'get help', 'Report a bug', 'report a bug', 'About', 'about'], Optional[str]]]"  [arg-type]

scikit-learn (https://github.com/scikit-learn/scikit-learn)
- sklearn/svm/tests/test_svm.py:595: error: List item 1 has incompatible type "Tuple[Type[NuSVC], str]"; expected "Tuple[Type[BaseSVC], str]"
+ sklearn/svm/tests/test_svm.py:595: error: List item 1 has incompatible type "Tuple[Type[NuSVC], LiteralString]"; expected "Tuple[Type[BaseSVC], str]"
- sklearn/ensemble/tests/test_stacking.py:544: error: List item 1 has incompatible type "Tuple[Type[StackingRegressor], Type[DummyRegressor], str, LinearRegression, Any, Any]"; expected "Tuple[ABCMeta, Type[MultiOutputMixin], str, BaseEstimator, Any, Any]"
+ sklearn/ensemble/tests/test_stacking.py:544: error: List item 1 has incompatible type "Tuple[Type[StackingRegressor], Type[DummyRegressor], LiteralString, LinearRegression, Any, Any]"; expected "Tuple[ABCMeta, Type[MultiOutputMixin], str, BaseEstimator, Any, Any]"

dragonchain (https://github.com/dragonchain/dragonchain)
- dragonchain/lib/database/redis_utest.py:61:42: error: Argument 2 to "zadd_async" has incompatible type "str"; expected "int"
+ dragonchain/lib/database/redis_utest.py:61:42: error: Argument 2 to "zadd_async" has incompatible type "LiteralString"; expected "int"
- dragonchain/lib/database/redis_utest.py:217:35: error: Argument 2 to "zadd_sync" has incompatible type "str"; expected "Dict[str, int]"
+ dragonchain/lib/database/redis_utest.py:217:35: error: Argument 2 to "zadd_sync" has incompatible type "LiteralString"; expected "Dict[str, int]"
- dragonchain/webserver/lib/api_keys_utest.py:48:87: error: Argument "permissions_document" to "create_api_key_v1" has incompatible type "Dict[str, str]"; expected "Optional[permissions_doc]"
+ dragonchain/webserver/lib/api_keys_utest.py:48:87: error: Argument "permissions_document" to "create_api_key_v1" has incompatible type "Dict[LiteralString, LiteralString]"; expected "Optional[permissions_doc]"
- dragonchain/webserver/lib/api_keys_utest.py:91:59: error: Argument 3 to "update_api_key_v1" has incompatible type "Dict[str, str]"; expected "Optional[permissions_doc]"
+ dragonchain/webserver/lib/api_keys_utest.py:91:59: error: Argument 3 to "update_api_key_v1" has incompatible type "Dict[LiteralString, LiteralString]"; expected "Optional[permissions_doc]"
- dragonchain/transaction_processor/level_1_actions_utest.py:132:39: error: List item 0 has incompatible type "Dict[str, str]"; expected "TransactionModel"
+ dragonchain/transaction_processor/level_1_actions_utest.py:132:39: error: List item 0 has incompatible type "Dict[LiteralString, LiteralString]"; expected "TransactionModel"
- dragonchain/transaction_processor/level_1_actions_utest.py:132:58: error: List item 1 has incompatible type "Dict[str, str]"; expected "TransactionModel"
+ dragonchain/transaction_processor/level_1_actions_utest.py:132:58: error: List item 1 has incompatible type "Dict[LiteralString, LiteralString]"; expected "TransactionModel"
- dragonchain/job_processor/contract_job_utest.py:199:38: error: Incompatible types in assignment (expression has type "Dict[str, str]", variable has type "SmartContractModel")
+ dragonchain/job_processor/contract_job_utest.py:199:38: error: Incompatible types in assignment (expression has type "Dict[LiteralString, LiteralString]", variable has type "SmartContractModel")

ibis (https://github.com/ibis-project/ibis)
- ibis/backends/pyspark/datatypes.py:83: error: Argument 1 to "singledispatch" has incompatible type "str"; expected "Callable[..., <nothing>]"
+ ibis/backends/pyspark/datatypes.py:83: error: Argument 1 to "singledispatch" has incompatible type "LiteralString"; expected "Callable[..., <nothing>]"

github-actions[bot] avatar Sep 14 '22 13:09 github-actions[bot]

Diff from mypy_primer, showing the effect of this PR on open source code:

rclip (https://github.com/yurijmikhalevich/rclip)
- rclip/db.py:70: error: Argument 1 to "update" of "MutableMapping" has incompatible type "NewImage"; expected "SupportsKeysAndGetItem[str, None]"
+ rclip/db.py:70: error: Argument 1 to "update" of "MutableMapping" has incompatible type "NewImage"; expected "SupportsKeysAndGetItem[LiteralString, None]"
- rclip/db.py:70: note:         def __getitem__(self, str, /) -> None
+ rclip/db.py:70: note:         def __getitem__(self, LiteralString, /) -> None

operator (https://github.com/canonical/operator)
- ops/model.py:1149: error: Incompatible types in assignment (expression has type "str", base class "StatusBase" defined the type as "_NotImplementedType")
+ ops/model.py:1149: error: Incompatible types in assignment (expression has type "LiteralString", base class "StatusBase" defined the type as "_NotImplementedType")
- ops/model.py:1165: error: Incompatible types in assignment (expression has type "str", base class "StatusBase" defined the type as "_NotImplementedType")
+ ops/model.py:1165: error: Incompatible types in assignment (expression has type "LiteralString", base class "StatusBase" defined the type as "_NotImplementedType")
- ops/model.py:1177: error: Incompatible types in assignment (expression has type "str", base class "StatusBase" defined the type as "_NotImplementedType")
+ ops/model.py:1177: error: Incompatible types in assignment (expression has type "LiteralString", base class "StatusBase" defined the type as "_NotImplementedType")
- ops/model.py:1189: error: Incompatible types in assignment (expression has type "str", base class "StatusBase" defined the type as "_NotImplementedType")
+ ops/model.py:1189: error: Incompatible types in assignment (expression has type "LiteralString", base class "StatusBase" defined the type as "_NotImplementedType")
- ops/model.py:1200: error: Incompatible types in assignment (expression has type "str", base class "StatusBase" defined the type as "_NotImplementedType")
+ ops/model.py:1200: error: Incompatible types in assignment (expression has type "LiteralString", base class "StatusBase" defined the type as "_NotImplementedType")
- ops/testing.py:129: error: Argument 2 to "Framework" has incompatible type "str"; expected "Path"
+ ops/testing.py:129: error: Argument 2 to "Framework" has incompatible type "LiteralString"; expected "Path"
- ops/testing.py:394: error: Incompatible types in assignment (expression has type "Path", variable has type "str")
+ ops/testing.py:394: error: Incompatible types in assignment (expression has type "Path", variable has type "LiteralString")
- ops/testing.py:397: error: Incompatible types in assignment (expression has type "str", variable has type "Optional[Dict[Any, Any]]")
+ ops/testing.py:397: error: Incompatible types in assignment (expression has type "LiteralString", variable has type "Optional[Dict[Any, Any]]")

apprise (https://github.com/caronc/apprise)
- apprise/cli.py:88: error: Incompatible types in assignment (expression has type "Tuple[str, str, str, str]", variable has type "Tuple[str, str, str, str, str, str, str, str]")
+ apprise/cli.py:88: error: Incompatible types in assignment (expression has type "Tuple[str, str, str, str]", variable has type "Tuple[LiteralString, LiteralString, LiteralString, LiteralString, LiteralString, LiteralString, LiteralString, LiteralString]")

psycopg (https://github.com/psycopg/psycopg)
+ psycopg/psycopg/abc.py:28: error: "LiteralString" is not fully supported yet, use --enable-incomplete-features  [misc]
+ psycopg/psycopg/sql.py:146: error: "LiteralString" is not fully supported yet, use --enable-incomplete-features  [misc]
+ psycopg/psycopg/sql.py:194: error: "LiteralString" is not fully supported yet, use --enable-incomplete-features  [misc]
+ psycopg/psycopg/sql.py:197: error: "LiteralString" is not fully supported yet, use --enable-incomplete-features  [misc]
+ psycopg/psycopg/sql.py:250: error: "LiteralString" is not fully supported yet, use --enable-incomplete-features  [misc]
+ psycopg/psycopg/connection.py:611: error: "LiteralString" is not fully supported yet, use --enable-incomplete-features  [misc]

pyppeteer (https://github.com/pyppeteer/pyppeteer)
- pyppeteer/launcher.py:149: error: Argument 2 to "Popen" has incompatible type "**Dict[str, Optional[Any]]"; expected "int"
+ pyppeteer/launcher.py:149: error: Argument 2 to "Popen" has incompatible type "**Dict[LiteralString, Optional[Any]]"; expected "int"
- pyppeteer/launcher.py:149: error: Argument 2 to "Popen" has incompatible type "**Dict[str, Optional[Any]]"; expected "bool"
+ pyppeteer/launcher.py:149: error: Argument 2 to "Popen" has incompatible type "**Dict[LiteralString, Optional[Any]]"; expected "bool"
- pyppeteer/launcher.py:149: error: Argument 2 to "Popen" has incompatible type "**Dict[str, Optional[Any]]"; expected "str"
+ pyppeteer/launcher.py:149: error: Argument 2 to "Popen" has incompatible type "**Dict[LiteralString, Optional[Any]]"; expected "str"

discord.py (https://github.com/Rapptz/discord.py)
- discord/mentions.py:136: error: Incompatible types in assignment (expression has type "List[str]", target has type "List[Union[Any, int]]")
+ discord/mentions.py:136: error: Incompatible types in assignment (expression has type "List[LiteralString]", target has type "List[Union[Any, int]]")
- discord/scheduled_event.py:461: error: Incompatible types in assignment (expression has type "Dict[str, str]", target has type "str")
+ discord/scheduled_event.py:461: error: Incompatible types in assignment (expression has type "Dict[LiteralString, str]", target has type "str")
- discord/http.py:226: error: No overload variant of "__setitem__" of "list" matches argument types "str", "bool"
+ discord/http.py:226: error: No overload variant of "__setitem__" of "list" matches argument types "LiteralString", "bool"
- discord/http.py:247: error: Dict entry 0 has incompatible type "str": "Dict[str, List[Embed]]"; expected "str": "List[Embed]"
+ discord/http.py:247: error: Dict entry 0 has incompatible type "LiteralString": "Dict[LiteralString, List[Embed]]"; expected "LiteralString": "List[Embed]"
- discord/http.py:254: error: Incompatible types in assignment (expression has type "None", variable has type "Dict[str, List[Embed]]")
+ discord/http.py:254: error: Incompatible types in assignment (expression has type "None", variable has type "Dict[LiteralString, List[Embed]]")
- discord/http.py:259: error: Dict entry 1 has incompatible type "str": "BufferedIOBase"; expected "str": "str"
+ discord/http.py:259: error: Dict entry 1 has incompatible type "LiteralString": "BufferedIOBase"; expected "str": "str"
- discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, BasicAuth, None, str]]"; expected "str"
+ discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[LiteralString, str], float, BasicAuth, None, str]]"; expected "str"
- discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, BasicAuth, None, str]]"; expected "Iterable[str]"
+ discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[LiteralString, str], float, BasicAuth, None, str]]"; expected "Iterable[str]"
- discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, BasicAuth, None, str]]"; expected "float"
+ discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[LiteralString, str], float, BasicAuth, None, str]]"; expected "float"
- discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, BasicAuth, None, str]]"; expected "Optional[float]"
+ discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[LiteralString, str], float, BasicAuth, None, str]]"; expected "Optional[float]"
- discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, BasicAuth, None, str]]"; expected "bool"
+ discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[LiteralString, str], float, BasicAuth, None, str]]"; expected "bool"
- discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, BasicAuth, None, str]]"; expected "Optional[BasicAuth]"
+ discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[LiteralString, str], float, BasicAuth, None, str]]"; expected "Optional[BasicAuth]"
- discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, BasicAuth, None, str]]"; expected "Optional[str]"
+ discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[LiteralString, str], float, BasicAuth, None, str]]"; expected "Optional[str]"
- discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, BasicAuth, None, str]]"; expected "Optional[Mapping[str, str]]"
+ discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[LiteralString, str], float, BasicAuth, None, str]]"; expected "Optional[Mapping[str, str]]"
- discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, BasicAuth, None, str]]"; expected "Union[Mapping[Union[str, istr], str], CIMultiDict[str], CIMultiDictProxy[str], None]"
+ discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[LiteralString, str], float, BasicAuth, None, str]]"; expected "Union[Mapping[Union[str, istr], str], CIMultiDict[str], CIMultiDictProxy[str], None]"
- discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, BasicAuth, None, str]]"; expected "Union[str, URL, None]"
+ discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[LiteralString, str], float, BasicAuth, None, str]]"; expected "Union[str, URL, None]"
- discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, BasicAuth, None, str]]"; expected "Union[SSLContext, bool, Fingerprint, None]"
+ discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[LiteralString, str], float, BasicAuth, None, str]]"; expected "Union[SSLContext, bool, Fingerprint, None]"
- discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, BasicAuth, None, str]]"; expected "Optional[bool]"
+ discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[LiteralString, str], float, BasicAuth, None, str]]"; expected "Optional[bool]"
- discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, BasicAuth, None, str]]"; expected "Optional[bytes]"
+ discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[LiteralString, str], float, BasicAuth, None, str]]"; expected "Optional[bytes]"
- discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, BasicAuth, None, str]]"; expected "Optional[SSLContext]"
+ discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[LiteralString, str], float, BasicAuth, None, str]]"; expected "Optional[SSLContext]"
- discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, BasicAuth, None, str]]"; expected "int"
+ discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[LiteralString, str], float, BasicAuth, None, str]]"; expected "int"
- discord/guild.py:2952: error: Incompatible types in assignment (expression has type "Dict[str, str]", target has type "str")
+ discord/guild.py:2952: error: Incompatible types in assignment (expression has type "Dict[LiteralString, str]", target has type "str")
- discord/webhook/async_.py:618: error: Dict entry 1 has incompatible type "str": "BufferedIOBase"; expected "str": "str"
+ discord/webhook/async_.py:618: error: Dict entry 1 has incompatible type "LiteralString": "BufferedIOBase"; expected "str": "str"
- discord/app_commands/tree.py:887: error: Incompatible types in assignment (expression has type "Union[str, locale_str]", variable has type "str")
+ discord/app_commands/tree.py:887: error: Incompatible types in assignment (expression has type "Union[str, locale_str]", variable has type "LiteralString")
- discord/app_commands/commands.py:1947: error: Incompatible types in assignment (expression has type "Union[str, locale_str]", variable has type "str")
+ discord/app_commands/commands.py:1947: error: Incompatible types in assignment (expression has type "Union[str, locale_str]", variable has type "LiteralString")
- discord/app_commands/commands.py:2008: error: Incompatible types in assignment (expression has type "Union[str, locale_str]", variable has type "str")
+ discord/app_commands/commands.py:2008: error: Incompatible types in assignment (expression has type "Union[str, locale_str]", variable has type "LiteralString")

prefect (https://github.com/PrefectHQ/prefect)
- src/prefect/filesystems.py:791: error: Argument 1 to "run_process" has incompatible type "str"; expected "List[str]"
+ src/prefect/filesystems.py:791: error: Argument 1 to "run_process" has incompatible type "LiteralString"; expected "List[str]"
- src/prefect/orion/database/configurations.py:214: error: Incompatible types in assignment (expression has type "str", target has type "Dict[str, Union[float, Any]]")
+ src/prefect/orion/database/configurations.py:214: error: Incompatible types in assignment (expression has type "LiteralString", target has type "Dict[LiteralString, Union[float, Any]]")
- src/prefect/infrastructure/kubernetes.py:302: error: Dict entry 2 has incompatible type "str": "Dict[str, Any]"; expected "str": "str"
+ src/prefect/infrastructure/kubernetes.py:302: error: Dict entry 2 has incompatible type "LiteralString": "Dict[str, Any]"; expected "str": "str"
- src/prefect/infrastructure/kubernetes.py:330: error: Dict entry 2 has incompatible type "str": "int"; expected "str": "str"
+ src/prefect/infrastructure/kubernetes.py:330: error: Dict entry 2 has incompatible type "LiteralString": "int"; expected "str": "str"
- src/prefect/infrastructure/kubernetes.py:339: error: Dict entry 2 has incompatible type "str": "List[str]"; expected "str": "str"
+ src/prefect/infrastructure/kubernetes.py:339: error: Dict entry 2 has incompatible type "LiteralString": "List[str]"; expected "str": "str"
- src/prefect/cli/flow_run.py:63: error: Dict entry 0 has incompatible type "str": "List[StateType]"; expected "str": "List[str]"
+ src/prefect/cli/flow_run.py:63: error: Dict entry 0 has incompatible type "LiteralString": "List[StateType]"; expected "LiteralString": "List[str]"

streamlit (https://github.com/streamlit/streamlit)
- lib/tests/streamlit/type_util_test.py:92:22: error: Argument 1 to "to_bytes" has incompatible type "str"; expected "Union[bytes, bytearray]"  [arg-type]
+ lib/tests/streamlit/type_util_test.py:92:22: error: Argument 1 to "to_bytes" has incompatible type "LiteralString"; expected "Union[bytes, bytearray]"  [arg-type]
- lib/tests/streamlit/runtime/legacy_caching/hashing_test.py:257:30: error: Unsupported operand types for + ("str" and "int")  [operator]
+ lib/tests/streamlit/runtime/legacy_caching/hashing_test.py:257:30: error: Unsupported operand types for + ("LiteralString" and "int")  [operator]
- lib/tests/streamlit/runtime/legacy_caching/hashing_test.py:335:33: error: Argument 1 to "UploadedFileRec" has incompatible type "str"; expected "int"  [arg-type]
+ lib/tests/streamlit/runtime/legacy_caching/hashing_test.py:335:33: error: Argument 1 to "UploadedFileRec" has incompatible type "LiteralString"; expected "int"  [arg-type]
- lib/tests/streamlit/runtime/legacy_caching/hashing_test.py:336:33: error: Argument 1 to "UploadedFileRec" has incompatible type "str"; expected "int"  [arg-type]
+ lib/tests/streamlit/runtime/legacy_caching/hashing_test.py:336:33: error: Argument 1 to "UploadedFileRec" has incompatible type "LiteralString"; expected "int"  [arg-type]
- lib/tests/streamlit/runtime/legacy_caching/hashing_test.py:337:33: error: Argument 1 to "UploadedFileRec" has incompatible type "str"; expected "int"  [arg-type]
+ lib/tests/streamlit/runtime/legacy_caching/hashing_test.py:337:33: error: Argument 1 to "UploadedFileRec" has incompatible type "LiteralString"; expected "int"  [arg-type]
- lib/tests/streamlit/delta_generator_test.py:514:25: error: Argument 1 has incompatible type "str"; expected "Union[int, float]"  [arg-type]
+ lib/tests/streamlit/delta_generator_test.py:514:25: error: Argument 1 has incompatible type "LiteralString"; expected "Union[int, float]"  [arg-type]
- lib/tests/streamlit/runtime/legacy_caching/caching_test.py:194:54: error: List item 0 has incompatible type "str"; expected "Callable[..., Any]"  [list-item]
+ lib/tests/streamlit/runtime/legacy_caching/caching_test.py:194:54: error: List item 0 has incompatible type "LiteralString"; expected "Callable[..., Any]"  [list-item]
- lib/tests/streamlit/elements/selectbox_test.py:131:51: error: Argument 3 has incompatible type "str"; expected "int"  [arg-type]
+ lib/tests/streamlit/elements/selectbox_test.py:131:51: error: Argument 3 has incompatible type "LiteralString"; expected "int"  [arg-type]
- lib/tests/streamlit/elements/radio_test.py:145:47: error: Argument 3 has incompatible type "str"; expected "int"  [arg-type]
+ lib/tests/streamlit/elements/radio_test.py:145:47: error: Argument 3 has incompatible type "LiteralString"; expected "int"  [arg-type]
- lib/tests/streamlit/elements/file_uploader_test.py:75:26: error: No overload variant matches argument types "str", "str", "bool"  [call-overload]
+ lib/tests/streamlit/elements/file_uploader_test.py:75:26: error: No overload variant matches argument types "LiteralString", "LiteralString", "bool"  [call-overload]
- lib/tests/streamlit/elements/file_uploader_test.py:190:13: error: No overload variant matches argument types "str", "str"  [call-overload]
+ lib/tests/streamlit/elements/file_uploader_test.py:190:13: error: No overload variant matches argument types "LiteralString", "LiteralString"  [call-overload]
- lib/tests/streamlit/commands/page_config_test.py:110:39: error: Argument "menu_items" to "set_page_config" has incompatible type "Dict[str, str]"; expected "Optional[Mapping[Literal['Get help', 'Get Help', 'get help', 'Report a bug', 'report a bug', 'About', 'about'], Optional[str]]]"  [arg-type]
+ lib/tests/streamlit/commands/page_config_test.py:110:39: error: Argument "menu_items" to "set_page_config" has incompatible type "Dict[LiteralString, LiteralString]"; expected "Optional[Mapping[Literal['Get help', 'Get Help', 'get help', 'Report a bug', 'report a bug', 'About', 'about'], Optional[str]]]"  [arg-type]
- lib/tests/streamlit/commands/page_config_test.py:146:43: error: Argument "menu_items" to "set_page_config" has incompatible type "Dict[str, str]"; expected "Optional[Mapping[Literal['Get help', 'Get Help', 'get help', 'Report a bug', 'report a bug', 'About', 'about'], Optional[str]]]"  [arg-type]
+ lib/tests/streamlit/commands/page_config_test.py:146:43: error: Argument "menu_items" to "set_page_config" has incompatible type "Dict[LiteralString, LiteralString]"; expected "Optional[Mapping[Literal['Get help', 'Get Help', 'get help', 'Report a bug', 'report a bug', 'About', 'about'], Optional[str]]]"  [arg-type]

scikit-learn (https://github.com/scikit-learn/scikit-learn)
- sklearn/svm/tests/test_svm.py:595: error: List item 1 has incompatible type "Tuple[Type[NuSVC], str]"; expected "Tuple[Type[BaseSVC], str]"
+ sklearn/svm/tests/test_svm.py:595: error: List item 1 has incompatible type "Tuple[Type[NuSVC], LiteralString]"; expected "Tuple[Type[BaseSVC], str]"
- sklearn/ensemble/tests/test_stacking.py:544: error: List item 1 has incompatible type "Tuple[Type[StackingRegressor], Type[DummyRegressor], str, LinearRegression, Any, Any]"; expected "Tuple[ABCMeta, Type[MultiOutputMixin], str, BaseEstimator, Any, Any]"
+ sklearn/ensemble/tests/test_stacking.py:544: error: List item 1 has incompatible type "Tuple[Type[StackingRegressor], Type[DummyRegressor], LiteralString, LinearRegression, Any, Any]"; expected "Tuple[ABCMeta, Type[MultiOutputMixin], str, BaseEstimator, Any, Any]"

dragonchain (https://github.com/dragonchain/dragonchain)
- dragonchain/lib/database/redis_utest.py:61:42: error: Argument 2 to "zadd_async" has incompatible type "str"; expected "int"
+ dragonchain/lib/database/redis_utest.py:61:42: error: Argument 2 to "zadd_async" has incompatible type "LiteralString"; expected "int"
- dragonchain/lib/database/redis_utest.py:217:35: error: Argument 2 to "zadd_sync" has incompatible type "str"; expected "Dict[str, int]"
+ dragonchain/lib/database/redis_utest.py:217:35: error: Argument 2 to "zadd_sync" has incompatible type "LiteralString"; expected "Dict[str, int]"
- dragonchain/webserver/lib/api_keys_utest.py:48:87: error: Argument "permissions_document" to "create_api_key_v1" has incompatible type "Dict[str, str]"; expected "Optional[permissions_doc]"
+ dragonchain/webserver/lib/api_keys_utest.py:48:87: error: Argument "permissions_document" to "create_api_key_v1" has incompatible type "Dict[LiteralString, LiteralString]"; expected "Optional[permissions_doc]"
- dragonchain/webserver/lib/api_keys_utest.py:91:59: error: Argument 3 to "update_api_key_v1" has incompatible type "Dict[str, str]"; expected "Optional[permissions_doc]"
+ dragonchain/webserver/lib/api_keys_utest.py:91:59: error: Argument 3 to "update_api_key_v1" has incompatible type "Dict[LiteralString, LiteralString]"; expected "Optional[permissions_doc]"
- dragonchain/transaction_processor/level_1_actions_utest.py:132:39: error: List item 0 has incompatible type "Dict[str, str]"; expected "TransactionModel"
+ dragonchain/transaction_processor/level_1_actions_utest.py:132:39: error: List item 0 has incompatible type "Dict[LiteralString, LiteralString]"; expected "TransactionModel"
- dragonchain/transaction_processor/level_1_actions_utest.py:132:58: error: List item 1 has incompatible type "Dict[str, str]"; expected "TransactionModel"
+ dragonchain/transaction_processor/level_1_actions_utest.py:132:58: error: List item 1 has incompatible type "Dict[LiteralString, LiteralString]"; expected "TransactionModel"
- dragonchain/job_processor/contract_job_utest.py:199:38: error: Incompatible types in assignment (expression has type "Dict[str, str]", variable has type "SmartContractModel")
+ dragonchain/job_processor/contract_job_utest.py:199:38: error: Incompatible types in assignment (expression has type "Dict[LiteralString, LiteralString]", variable has type "SmartContractModel")

ibis (https://github.com/ibis-project/ibis)
- ibis/backends/pyspark/datatypes.py:83: error: Argument 1 to "singledispatch" has incompatible type "str"; expected "Callable[..., <nothing>]"
+ ibis/backends/pyspark/datatypes.py:83: error: Argument 1 to "singledispatch" has incompatible type "LiteralString"; expected "Callable[..., <nothing>]"

github-actions[bot] avatar Sep 14 '22 14:09 github-actions[bot]

Diff from mypy_primer, showing the effect of this PR on open source code:

psycopg (https://github.com/psycopg/psycopg)
+ psycopg/psycopg/abc.py:28: error: "LiteralString" is not fully supported yet, use --enable-incomplete-features  [misc]
+ psycopg/psycopg/sql.py:146: error: "LiteralString" is not fully supported yet, use --enable-incomplete-features  [misc]
+ psycopg/psycopg/sql.py:194: error: "LiteralString" is not fully supported yet, use --enable-incomplete-features  [misc]
+ psycopg/psycopg/sql.py:197: error: "LiteralString" is not fully supported yet, use --enable-incomplete-features  [misc]
+ psycopg/psycopg/sql.py:250: error: "LiteralString" is not fully supported yet, use --enable-incomplete-features  [misc]
+ psycopg/psycopg/connection.py:611: error: "LiteralString" is not fully supported yet, use --enable-incomplete-features  [misc]

github-actions[bot] avatar Sep 14 '22 17:09 github-actions[bot]

I consider the very first version done! 🎉 Feedback is more than welcome!

sobolevn avatar Sep 14 '22 17:09 sobolevn

Diff from mypy_primer, showing the effect of this PR on open source code:

sphinx (https://github.com/sphinx-doc/sphinx)
+ sphinx/setup_command.py:133:43: error: Argument 1 to "join" has incompatible type "str"; expected "LiteralString"  [arg-type]

psycopg (https://github.com/psycopg/psycopg)
+ psycopg/psycopg/_typeinfo.py:93: error: Argument 1 to "execute" of "Cursor" has incompatible type "str"; expected "Union[LiteralString, bytes, SQL, Composed]"  [arg-type]
+ psycopg/psycopg/_typeinfo.py:112: error: Argument 1 to "execute" of "AsyncCursor" has incompatible type "str"; expected "Union[LiteralString, bytes, SQL, Composed]"  [arg-type]
+ psycopg/psycopg/server_cursor.py:170: error: Argument 1 to "SQL" has incompatible type "str"; expected "LiteralString"  [arg-type]
+ psycopg/psycopg/server_cursor.py:179: error: Incompatible types in assignment (expression has type "str", variable has type "Union[LiteralString, bytes, SQL, Composed]")  [assignment]
+ psycopg/psycopg/server_cursor.py:181: error: Argument 1 to "SQL" has incompatible type "Union[LiteralString, bytes]"; expected "LiteralString"  [arg-type]
+ psycopg/psycopg/server_cursor.py:188: error: Argument 1 to "SQL" has incompatible type "str"; expected "LiteralString"  [arg-type]
+ psycopg/psycopg/connection.py:1022: error: Argument 1 to "execute" of "Cursor" has incompatible type "str"; expected "Union[LiteralString, bytes, SQL, Composed]"  [arg-type]
+ psycopg/psycopg/connection_async.py:430: error: Argument 1 to "execute" of "AsyncCursor" has incompatible type "str"; expected "Union[LiteralString, bytes, SQL, Composed]"  [arg-type]
+ tests/scripts/dectest.py:31: error: Argument 1 to "copy" of "Cursor" has incompatible type "str"; expected "Union[LiteralString, bytes, SQL, Composed]"  [arg-type]
+ tests/scripts/dectest.py:40: error: Argument 1 to "executemany" of "Cursor" has incompatible type "str"; expected "Union[LiteralString, bytes, SQL, Composed]"  [arg-type]
+ tests/crdb/test_copy.py:209: error: Argument 1 to "SQL" has incompatible type "str"; expected "LiteralString"  [arg-type]
+ tests/crdb/test_copy_async.py:215: error: Argument 1 to "SQL" has incompatible type "str"; expected "LiteralString"  [arg-type]
+ tests/test_sql.py:466: error: Argument 1 to "SQL" has incompatible type "str"; expected "LiteralString"  [arg-type]
+ tests/test_sql.py:534: error: Argument 1 to "SQL" has incompatible type "str"; expected "LiteralString"  [arg-type]
+ tests/types/test_numeric.py:580: error: Argument 1 to "SQL" has incompatible type "str"; expected "LiteralString"  [arg-type]

spark (https://github.com/apache/spark)
+ python/pyspark/pandas/sql_formatter.py:194: error: Signature of "vformat" incompatible with supertype "Formatter"  [override]
+ python/pyspark/pandas/sql_formatter.py:194: note:      Superclass:
+ python/pyspark/pandas/sql_formatter.py:194: note:          @overload
+ python/pyspark/pandas/sql_formatter.py:194: note:          def vformat(self, format_string: LiteralString, args: Sequence[LiteralString], kwargs: Mapping[LiteralString, LiteralString]) -> LiteralString
+ python/pyspark/pandas/sql_formatter.py:194: note:          @overload
+ python/pyspark/pandas/sql_formatter.py:194: note:          def vformat(self, format_string: str, args: Sequence[Any], kwargs: Mapping[str, Any]) -> str
+ python/pyspark/pandas/sql_formatter.py:194: note:      Subclass:
+ python/pyspark/pandas/sql_formatter.py:194: note:          def vformat(self, format_string: str, args: Sequence[Any], kwargs: Mapping[str, Any]) -> str

github-actions[bot] avatar Sep 14 '22 17:09 github-actions[bot]

Primer output

sphinx

This is the case for sphinx:

@overload
def join(__a: LiteralString, *paths: LiteralString) -> LiteralString: ...
@overload
def join(__a: StrPath, *paths: StrPath) -> str: ...
@overload
def join(__a: BytesPath, *paths: BytesPath) -> bytes: ...

Looks like I need to add tests with @overload decorators just to be sure. The case is that one argument is LiteralString, other is str. So, it cannot find an overload: https://github.com/sphinx-doc/sphinx/blob/5.x/sphinx/setup_command.py#L133

psycopg2

It is actually correct:

  • cursor.execute expects LiteralString https://github.com/psycopg/psycopg/blob/e6f1f1a76cae0af5bf66742e2875bf26a4e823f8/psycopg/psycopg/abc.py#L28 but str is passed https://github.com/psycopg/psycopg/blob/e6f1f1a76cae0af5bf66742e2875bf26a4e823f8/psycopg/psycopg/_typeinfo.py#L93

pyspark

Mypy is also correct here. Not all overloads are covered, string.Formatter has one more: https://github.com/apache/spark/blob/12e48527846d993a78b159fbba3e900a4feb7b55/python/pyspark/pandas/sql_formatter.py#L194

sobolevn avatar Sep 14 '22 18:09 sobolevn

Diff from mypy_primer, showing the effect of this PR on open source code:

sphinx (https://github.com/sphinx-doc/sphinx)
+ sphinx/setup_command.py:133:43: error: Argument 1 to "join" has incompatible type "str"; expected "LiteralString"  [arg-type]

psycopg (https://github.com/psycopg/psycopg)
+ psycopg/psycopg/_typeinfo.py:93: error: Argument 1 to "execute" of "Cursor" has incompatible type "str"; expected "Union[LiteralString, bytes, SQL, Composed]"  [arg-type]
+ psycopg/psycopg/_typeinfo.py:112: error: Argument 1 to "execute" of "AsyncCursor" has incompatible type "str"; expected "Union[LiteralString, bytes, SQL, Composed]"  [arg-type]
+ psycopg/psycopg/server_cursor.py:170: error: Argument 1 to "SQL" has incompatible type "str"; expected "LiteralString"  [arg-type]
+ psycopg/psycopg/server_cursor.py:179: error: Incompatible types in assignment (expression has type "str", variable has type "Union[LiteralString, bytes, SQL, Composed]")  [assignment]
+ psycopg/psycopg/server_cursor.py:181: error: Argument 1 to "SQL" has incompatible type "Union[LiteralString, bytes]"; expected "LiteralString"  [arg-type]
+ psycopg/psycopg/server_cursor.py:188: error: Argument 1 to "SQL" has incompatible type "str"; expected "LiteralString"  [arg-type]
+ psycopg/psycopg/connection.py:1022: error: Argument 1 to "execute" of "Cursor" has incompatible type "str"; expected "Union[LiteralString, bytes, SQL, Composed]"  [arg-type]
+ psycopg/psycopg/connection_async.py:430: error: Argument 1 to "execute" of "AsyncCursor" has incompatible type "str"; expected "Union[LiteralString, bytes, SQL, Composed]"  [arg-type]
+ tests/scripts/dectest.py:31: error: Argument 1 to "copy" of "Cursor" has incompatible type "str"; expected "Union[LiteralString, bytes, SQL, Composed]"  [arg-type]
+ tests/scripts/dectest.py:40: error: Argument 1 to "executemany" of "Cursor" has incompatible type "str"; expected "Union[LiteralString, bytes, SQL, Composed]"  [arg-type]
+ tests/crdb/test_copy.py:209: error: Argument 1 to "SQL" has incompatible type "str"; expected "LiteralString"  [arg-type]
+ tests/crdb/test_copy_async.py:215: error: Argument 1 to "SQL" has incompatible type "str"; expected "LiteralString"  [arg-type]
+ tests/test_sql.py:466: error: Argument 1 to "SQL" has incompatible type "str"; expected "LiteralString"  [arg-type]
+ tests/test_sql.py:534: error: Argument 1 to "SQL" has incompatible type "str"; expected "LiteralString"  [arg-type]
+ tests/types/test_numeric.py:580: error: Argument 1 to "SQL" has incompatible type "str"; expected "LiteralString"  [arg-type]

spark (https://github.com/apache/spark)
+ python/pyspark/pandas/sql_formatter.py:194: error: Signature of "vformat" incompatible with supertype "Formatter"  [override]
+ python/pyspark/pandas/sql_formatter.py:194: note:      Superclass:
+ python/pyspark/pandas/sql_formatter.py:194: note:          @overload
+ python/pyspark/pandas/sql_formatter.py:194: note:          def vformat(self, format_string: LiteralString, args: Sequence[LiteralString], kwargs: Mapping[LiteralString, LiteralString]) -> LiteralString
+ python/pyspark/pandas/sql_formatter.py:194: note:          @overload
+ python/pyspark/pandas/sql_formatter.py:194: note:          def vformat(self, format_string: str, args: Sequence[Any], kwargs: Mapping[str, Any]) -> str
+ python/pyspark/pandas/sql_formatter.py:194: note:      Subclass:
+ python/pyspark/pandas/sql_formatter.py:194: note:          def vformat(self, format_string: str, args: Sequence[Any], kwargs: Mapping[str, Any]) -> str

github-actions[bot] avatar Sep 14 '22 18:09 github-actions[bot]

Diff from mypy_primer, showing the effect of this PR on open source code:

sphinx (https://github.com/sphinx-doc/sphinx)
+ sphinx/setup_command.py:133:43: error: Argument 1 to "join" has incompatible type "str"; expected "LiteralString"  [arg-type]

psycopg (https://github.com/psycopg/psycopg)
+ psycopg/psycopg/_typeinfo.py:93: error: Argument 1 to "execute" of "Cursor" has incompatible type "str"; expected "Union[LiteralString, bytes, SQL, Composed]"  [arg-type]
+ psycopg/psycopg/_typeinfo.py:112: error: Argument 1 to "execute" of "AsyncCursor" has incompatible type "str"; expected "Union[LiteralString, bytes, SQL, Composed]"  [arg-type]
+ psycopg/psycopg/server_cursor.py:170: error: Argument 1 to "SQL" has incompatible type "str"; expected "LiteralString"  [arg-type]
+ psycopg/psycopg/server_cursor.py:179: error: Incompatible types in assignment (expression has type "str", variable has type "Union[LiteralString, bytes, SQL, Composed]")  [assignment]
+ psycopg/psycopg/server_cursor.py:181: error: Argument 1 to "SQL" has incompatible type "Union[LiteralString, bytes]"; expected "LiteralString"  [arg-type]
+ psycopg/psycopg/server_cursor.py:188: error: Argument 1 to "SQL" has incompatible type "str"; expected "LiteralString"  [arg-type]
+ psycopg/psycopg/connection.py:1022: error: Argument 1 to "execute" of "Cursor" has incompatible type "str"; expected "Union[LiteralString, bytes, SQL, Composed]"  [arg-type]
+ psycopg/psycopg/connection_async.py:430: error: Argument 1 to "execute" of "AsyncCursor" has incompatible type "str"; expected "Union[LiteralString, bytes, SQL, Composed]"  [arg-type]
+ tests/scripts/dectest.py:31: error: Argument 1 to "copy" of "Cursor" has incompatible type "str"; expected "Union[LiteralString, bytes, SQL, Composed]"  [arg-type]
+ tests/scripts/dectest.py:40: error: Argument 1 to "executemany" of "Cursor" has incompatible type "str"; expected "Union[LiteralString, bytes, SQL, Composed]"  [arg-type]
+ tests/crdb/test_copy.py:209: error: Argument 1 to "SQL" has incompatible type "str"; expected "LiteralString"  [arg-type]
+ tests/crdb/test_copy_async.py:215: error: Argument 1 to "SQL" has incompatible type "str"; expected "LiteralString"  [arg-type]
+ tests/test_sql.py:466: error: Argument 1 to "SQL" has incompatible type "str"; expected "LiteralString"  [arg-type]
+ tests/test_sql.py:534: error: Argument 1 to "SQL" has incompatible type "str"; expected "LiteralString"  [arg-type]
+ tests/types/test_numeric.py:580: error: Argument 1 to "SQL" has incompatible type "str"; expected "LiteralString"  [arg-type]

spark (https://github.com/apache/spark)
+ python/pyspark/pandas/sql_formatter.py:194: error: Signature of "vformat" incompatible with supertype "Formatter"  [override]
+ python/pyspark/pandas/sql_formatter.py:194: note:      Superclass:
+ python/pyspark/pandas/sql_formatter.py:194: note:          @overload
+ python/pyspark/pandas/sql_formatter.py:194: note:          def vformat(self, format_string: LiteralString, args: Sequence[LiteralString], kwargs: Mapping[LiteralString, LiteralString]) -> LiteralString
+ python/pyspark/pandas/sql_formatter.py:194: note:          @overload
+ python/pyspark/pandas/sql_formatter.py:194: note:          def vformat(self, format_string: str, args: Sequence[Any], kwargs: Mapping[str, Any]) -> str
+ python/pyspark/pandas/sql_formatter.py:194: note:      Subclass:
+ python/pyspark/pandas/sql_formatter.py:194: note:          def vformat(self, format_string: str, args: Sequence[Any], kwargs: Mapping[str, Any]) -> str

github-actions[bot] avatar Sep 14 '22 18:09 github-actions[bot]

Currently we patch typeshed... Can we revert https://github.com/python/mypy/pull/13093 in this PR and see if everything works?

hauntsaninja avatar Sep 15 '22 18:09 hauntsaninja

Currently we patch typeshed... Can we revert https://github.com/python/mypy/pull/13093 in this PR and see if everything works?

+1 to this idea.

ilevkivskyi avatar Sep 16 '22 14:09 ilevkivskyi

I am away for a week, I will return to this shortly after I get home! Thanks for your feedback.

sobolevn avatar Sep 16 '22 15:09 sobolevn

Adding this back to my todo list :)

sobolevn avatar Oct 10 '22 08:10 sobolevn

Diff from mypy_primer, showing the effect of this PR on open source code:

sphinx (https://github.com/sphinx-doc/sphinx)
+ sphinx/setup_command.py:133:43: error: Argument 1 to "join" has incompatible type "str"; expected "LiteralString"  [arg-type]

psycopg (https://github.com/psycopg/psycopg)
+ psycopg/psycopg/_typeinfo.py:93: error: Argument 1 to "execute" of "Cursor" has incompatible type "str"; expected "Union[LiteralString, bytes, SQL, Composed]"  [arg-type]
+ psycopg/psycopg/_typeinfo.py:112: error: Argument 1 to "execute" of "AsyncCursor" has incompatible type "str"; expected "Union[LiteralString, bytes, SQL, Composed]"  [arg-type]
+ psycopg/psycopg/server_cursor.py:170: error: Argument 1 to "SQL" has incompatible type "str"; expected "LiteralString"  [arg-type]
+ psycopg/psycopg/server_cursor.py:179: error: Incompatible types in assignment (expression has type "str", variable has type "Union[LiteralString, bytes, SQL, Composed]")  [assignment]
+ psycopg/psycopg/server_cursor.py:181: error: Argument 1 to "SQL" has incompatible type "Union[LiteralString, bytes]"; expected "LiteralString"  [arg-type]
+ psycopg/psycopg/server_cursor.py:188: error: Argument 1 to "SQL" has incompatible type "str"; expected "LiteralString"  [arg-type]
+ psycopg/psycopg/connection.py:1024: error: Argument 1 to "execute" of "Cursor" has incompatible type "str"; expected "Union[LiteralString, bytes, SQL, Composed]"  [arg-type]
+ psycopg/psycopg/connection_async.py:430: error: Argument 1 to "execute" of "AsyncCursor" has incompatible type "str"; expected "Union[LiteralString, bytes, SQL, Composed]"  [arg-type]
+ tests/scripts/dectest.py:31: error: Argument 1 to "copy" of "Cursor" has incompatible type "str"; expected "Union[LiteralString, bytes, SQL, Composed]"  [arg-type]
+ tests/scripts/dectest.py:40: error: Argument 1 to "executemany" of "Cursor" has incompatible type "str"; expected "Union[LiteralString, bytes, SQL, Composed]"  [arg-type]
+ tests/crdb/test_copy.py:209: error: Argument 1 to "SQL" has incompatible type "str"; expected "LiteralString"  [arg-type]
+ tests/crdb/test_copy_async.py:215: error: Argument 1 to "SQL" has incompatible type "str"; expected "LiteralString"  [arg-type]
+ tests/test_sql.py:466: error: Argument 1 to "SQL" has incompatible type "str"; expected "LiteralString"  [arg-type]
+ tests/test_sql.py:534: error: Argument 1 to "SQL" has incompatible type "str"; expected "LiteralString"  [arg-type]
+ tests/types/test_numeric.py:580: error: Argument 1 to "SQL" has incompatible type "str"; expected "LiteralString"  [arg-type]

spark (https://github.com/apache/spark)
+ python/pyspark/pandas/sql_formatter.py:194: error: Signature of "vformat" incompatible with supertype "Formatter"  [override]
+ python/pyspark/pandas/sql_formatter.py:194: note:      Superclass:
+ python/pyspark/pandas/sql_formatter.py:194: note:          @overload
+ python/pyspark/pandas/sql_formatter.py:194: note:          def vformat(self, format_string: LiteralString, args: Sequence[LiteralString], kwargs: Mapping[LiteralString, LiteralString]) -> LiteralString
+ python/pyspark/pandas/sql_formatter.py:194: note:          @overload
+ python/pyspark/pandas/sql_formatter.py:194: note:          def vformat(self, format_string: str, args: Sequence[Any], kwargs: Mapping[str, Any]) -> str
+ python/pyspark/pandas/sql_formatter.py:194: note:      Subclass:
+ python/pyspark/pandas/sql_formatter.py:194: note:          def vformat(self, format_string: str, args: Sequence[Any], kwargs: Mapping[str, Any]) -> str

github-actions[bot] avatar Oct 10 '22 08:10 github-actions[bot]