Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce mypy errors (Part 30) #9891

Closed
twisted-trac opened this issue Jul 2, 2020 · 3 comments
Closed

Reduce mypy errors (Part 30) #9891

twisted-trac opened this issue Jul 2, 2020 · 3 comments

Comments

@twisted-trac
Copy link

rodrigc's avatar @rodrigc reported
Trac ID trac#9891
Type enhancement
Created 2020-07-02 23:45:36Z

This is a continuation of ticket:9890

It would be good to clean up mypy errors such as:

+src/twisted/internet/tcp.py:1027:5: error: Signature of "_FileDescriptorReservation" incompatible with "__exit__" of supertype "_IFileDescriptorReservation"  [override]
+        def __exit__(self, excValue, excType, traceback):
+        ^
+src/twisted/internet/tcp.py:1069:5: error: Signature of "_NullFileDescriptorReservation" incompatible with "__exit__" of supertype "_IFileDescriptorReservation"
+[override]
+        def __exit__(self, excValue, excType, traceback):
+        ^
+src/twisted/internet/testing.py:871:5: error: Signature of "RaisingMemoryReactor" incompatible with "adoptDatagramPort" of supertype "IReactorSocket"  [override]
+        def adoptDatagramPort(self, fileDescriptor, addressFamily, protocol,
+        ^
+src/twisted/internet/testing.py:880:5: error: Signature of "RaisingMemoryReactor" incompatible with "adoptStreamConnection" of supertype "IReactorSocket"  [override]
+        def adoptStreamConnection(self):
+        ^
+src/twisted/test/stdio_test_halfclose.py:58:5: error: Signature of "HalfCloseProtocol" incompatible with "writeConnectionLost" of supertype "IHalfCloseableProtocol"
+[override]
+        def writeConnectionLost(self, reason):
+        ^
+src/twisted/conch/scripts/cftp.py:40:21: error: Incompatible types in assignment (expression has type "List[List[Union[str, int, None]]]", base class "ConchOptions"
+defined the type as "List[List[Optional[str]]]")  [assignment]
+        optParameters = [
+                        ^
+src/twisted/web/_auth/wrapper.py:243:5: error: Signature of "HTTPAuthSessionWrapper" incompatible with "putChild" of supertype "IResource"  [override]
+        def putChild(self, child):
+        ^
+src/twisted/python/test/test_shellcomp.py:485:31: error: List item 1 has incompatible type "None"; expected "str"  [list-item]
+        optFlags = [['no-stalls', None,
+                                  ^
+src/twisted/mail/test/test_smtp.py:434:22: error: Argument 1 to "append" of "list" has incompatible type
+"Tuple[bytes, bytes, bytes, Tuple[bytes, Tuple[bytes, bytes, List[bytes], bytes]]]"; expected "Tuple[bytes, bytes, None, None]"  [arg-type]
+            data.append((b'DATA\r\n', b'354.*\r\n',
+                         ^
+src/twisted/conch/test/test_userauth.py:246:5: error: Signature of "AnonymousChecker" incompatible with "requestAvatarId" of supertype "ICredentialsChecker"  [override]
+        def requestAvatarId(credentials):
+        ^
+src/twisted/internet/test/test_tcp.py:462:5: error: Signature of "FakeResolver" incompatible with "getHostByName" of supertype "IResolverSimple"  [override]
+        def getHostByName(self, name, timeout):
+        ^
Searchable metadata
trac-id__9891 9891
type__enhancement enhancement
reporter__rodrigc rodrigc
priority__normal normal
milestone__publish_types publish types
branch__ 
branch_author__ 
status__closed closed
resolution__fixed fixed
component__core core
keywords__None None
time__1593733536054143 1593733536054143
changetime__1594360403322407 1594360403322407
version__None None
owner__Craig_Rodrigues__rodrigc_____ Craig Rodrigues <rodrigc@...>

@twisted-trac
Copy link
Author

rodrigc's avatar @rodrigc commented

#1335

@twisted-trac
Copy link
Author

rodrigc's avatar @rodrigc commented

Approved here: #1335 (review)

@twisted-trac
Copy link
Author

rodrigc's avatar @rodrigc set owner to @rodrigc
@rodrigc set status to closed

In changeset 46eec37

#!CommitTicketReference repository="" revision="46eec37a4be7ff2c004dad949c5d1d563b2d437b"
Merge pull request #1335 from twisted/9891-rodrigc-mypy

[mypy] [9891] Reduce mypy errors

Author: rodrigc
Reviewer: adiroiban
Fixes: ticket:9891

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

No branches or pull requests

1 participant