KEMBAR78
Prevent assignment to None for non-Optional class variables by hauntsaninja · Pull Request #20054 · python/mypy · GitHub
Skip to content

Conversation

@hauntsaninja
Copy link
Collaborator

Python 3.5 has been dead for a long time.

@github-actions
Copy link
Contributor

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

tornado (https://github.com/tornadoweb/tornado)
+ tornado/util.py:240: error: Incompatible types in assignment (expression has type "None", variable has type "dict[str, Any]")  [assignment]
+ tornado/httputil.py:469: error: Incompatible types in assignment (expression has type "None", variable has type "str")  [assignment]
+ tornado/httputil.py:470: error: Incompatible types in assignment (expression has type "None", variable has type "str")  [assignment]
+ tornado/httputil.py:473: error: Incompatible types in assignment (expression has type "None", variable has type "Future[None]")  [assignment]
+ tornado/netutil.py:519: error: Incompatible types in assignment (expression has type "None", variable has type "int")  [assignment]
+ tornado/iostream.py:1327: error: Incompatible types in assignment (expression has type "None", variable has type "SSLSocket")  [assignment]
+ tornado/httpclient.py:179: error: Incompatible types in assignment (expression has type "None", variable has type "dict[IOLoop, AsyncHTTPClient]")  [assignment]
+ tornado/httpclient.py:342: error: Incompatible types in assignment (expression has type "None", variable has type "dict[str, str] | HTTPHeaders")  [assignment]
+ tornado/httpclient.py:629: error: Incompatible types in assignment (expression has type "None", variable has type "HTTPRequest")  [assignment]
+ tornado/web.py:208: error: Incompatible types in assignment (expression has type "None", variable has type "list[OutputTransform]")  [assignment]
+ tornado/web.py:209: error: Incompatible types in assignment (expression has type "None", variable has type "list[str]")  [assignment]
+ tornado/web.py:210: error: Incompatible types in assignment (expression has type "None", variable has type "dict[str, str]")  [assignment]
+ tornado/websocket.py:837: error: Incompatible types in assignment (expression has type "None", variable has type "IOStream")  [assignment]
+ tornado/websocket.py:1399: error: Incompatible types in assignment (expression has type "None", variable has type "WebSocketProtocol")  [assignment]
+ tornado/test/web_test.py:224: error: Incompatible types in assignment (expression has type "None", variable has type "Future[Any]")  [assignment]

dd-trace-py (https://github.com/DataDog/dd-trace-py)
+ ddtrace/internal/remoteconfig/_pubsub.py:85: error: Incompatible types in assignment (expression has type "None", variable has type "PublisherSubscriberConnector")  [assignment]
+ ddtrace/internal/remoteconfig/_pubsub.py:86: error: Incompatible types in assignment (expression has type "None", variable has type "RemoteConfigPublisherBase")  [assignment]
+ ddtrace/internal/remoteconfig/_pubsub.py:87: error: Incompatible types in assignment (expression has type "None", variable has type "RemoteConfigSubscriber")  [assignment]
+ ddtrace/llmobs/_llmobs.py:186: error: Incompatible types in assignment (expression has type "None", variable has type "LLMObs")  [assignment]

arviz (https://github.com/arviz-devs/arviz)
+ arviz/data/io_pyro.py:24: error: Incompatible types in assignment (expression has type "None", variable has type "int")  [assignment]
+ arviz/data/io_pyro.py:25: error: Incompatible types in assignment (expression has type "None", variable has type "int")  [assignment]
+ arviz/data/io_numpyro.py:87: error: Incompatible types in assignment (expression has type "None", variable has type "int")  [assignment]
+ arviz/data/io_numpyro.py:88: error: Incompatible types in assignment (expression has type "None", variable has type "int")  [assignment]

alerta (https://github.com/alerta/alerta)
+ alerta/models/alarms/__init__.py:22: error: Incompatible types in assignment (expression has type "None", variable has type "str")  [assignment]
+ alerta/models/alarms/__init__.py:23: error: Incompatible types in assignment (expression has type "None", variable has type "str")  [assignment]
+ alerta/models/alarms/__init__.py:24: error: Incompatible types in assignment (expression has type "None", variable has type "str")  [assignment]
+ alerta/models/alarms/__init__.py:25: error: Incompatible types in assignment (expression has type "None", variable has type "str")  [assignment]

stone (https://github.com/dropbox/stone)
+ stone/backend.py:92: error: Incompatible types in assignment (expression has type "None", variable has type "ArgumentParser")  [assignment]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants