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 25) #9883

Closed
twisted-trac opened this issue Jun 30, 2020 · 3 comments
Closed

Reduce mypy errors (Part 25) #9883

twisted-trac opened this issue Jun 30, 2020 · 3 comments

Comments

@twisted-trac
Copy link

rodrigc's avatar @rodrigc reported
Trac ID trac#9883
Type enhancement
Created 2020-06-30 19:40:44Z

This is a continuation of ticket:9882

It would be good to clean up these mypy errors:

src/twisted/python/usage.py:191:16: error: Incompatible types in assignment (expression has type "Callable[[object], int]", base class "dict" defined the type as "None")  [assignment]
        __hash__ = object.__hash__  # type: Callable[[object], int]
                   ^
src/twisted/internet/serialport.py:86:5: error: Incompatible import of "SerialPort" (imported name has type "Type[twisted.internet._posixserialport.SerialPort]", local name has type
"Type[twisted.internet._win32serialport.SerialPort]")  [misc]
        from twisted.internet._posixserialport import SerialPort
        ^
src/twisted/internet/stdio.py:34:5: error: Incompatible import of "StandardIO" (imported name has type "Type[twisted.internet._posixstdio.StandardIO]", local name has type
"Type[twisted.internet._win32stdio.StandardIO]")  [misc]
        from twisted.internet._posixstdio import StandardIO, PipeAddress
        ^
src/twisted/internet/stdio.py:34:5: error: Incompatible import of "PipeAddress" (imported name has type "Type[PipeAddress]", local name has type "Type[Win32PipeAddress]")  [misc]
        from twisted.internet._posixstdio import StandardIO, PipeAddress
        ^
src/twisted/test/stdio_test_writeseq.py:34:5: error: Module has no attribute "run"  [attr-defined]
        reactor.run()
        ^
src/twisted/test/stdio_test_write.py:36:5: error: Module has no attribute "run"  [attr-defined]
        reactor.run()
        ^
src/twisted/test/stdio_test_producer.py:58:5: error: Module has no attribute "run"  [attr-defined]
        reactor.run()
        ^
src/twisted/test/stdio_test_loseconn.py:48:5: error: Module has no attribute "run"  [attr-defined]
        reactor.run()
        ^
src/twisted/test/stdio_test_hostpeer.py:33:5: error: Module has no attribute "run"  [attr-defined]
        reactor.run()
        ^
src/twisted/test/stdio_test_halfclose.py:70:5: error: Module has no attribute "run"  [attr-defined]
        reactor.run()
        ^
src/twisted/test/stdio_test_consumer.py:45:5: error: Module has no attribute "run"  [attr-defined]
        reactor.run()
        ^
src/twisted/test/process_twisted.py:45:1: error: Module has no attribute "run"  [attr-defined]
    reactor.run()
    ^
src/twisted/internet/endpoints.py:45:5: error: Cannot assign multiple types to name "StandardIO" without an explicit "Type[...]" annotation  [misc]
        StandardIO = None  # type: ignore[assignment]
        ^
src/twisted/internet/endpoints.py:46:5: error: Cannot assign multiple types to name "PipeAddress" without an explicit "Type[...]" annotation  [misc]
        PipeAddress = None  # type: ignore[assignment]
src/twisted/application/twist/_options.py:73:34: error: Argument 1 to "dedent" has incompatible type "Optional[str]"; expected "str"  [arg-type]
        opt_reactor.__doc__ = dedent(opt_reactor.__doc__).format(
                                     ^
src/twisted/application/twist/_options.py:101:36: error: Argument 1 to "dedent" has incompatible type "Optional[str]"; expected "str"  [arg-type]
        opt_log_level.__doc__ = dedent(opt_log_level.__doc__).format(
                                       ^
src/twisted/application/twist/_options.py:146:37: error: Argument 1 to "dedent" has incompatible type "Optional[str]"; expected "str"  [arg-type]
        opt_log_format.__doc__ = dedent(opt_log_format.__doc__)
                                        ^
src/twisted/words/test/test_xpath.py:11:1: error: Module 'twisted.words.xish.xpathparser' has no attribute 'SyntaxError'  [attr-defined]
    from twisted.words.xish.xpathparser import SyntaxError
    ^
src/twisted/pair/test/test_tuntap.py:540:1: error: "Type[FakeTapDeviceTests]" has no attribute "helper"  [attr-defined]
    FakeTapDeviceTests.helper = TapHelper(
    ^
src/twisted/pair/test/test_tuntap.py:552:1: error: "Type[FakeTapDeviceWithPITests]" has no attribute "helper"  [attr-defined]
    FakeTapDeviceWithPITests.helper = TapHelper(
    ^
src/twisted/pair/test/test_tuntap.py:563:1: error: "Type[FakeTunDeviceTests]" has no attribute "helper"  [attr-defined]
    FakeTunDeviceTests.helper = TunHelper(
    ^
src/twisted/pair/test/test_tuntap.py:1334:5: error: Signature of "IPRecordingProtocol" incompatible with "datagramReceived" of supertype "IRawPacketProtocol"  [override]
src/twisted/pair/test/test_tuntap.py:1349:24: error: Incompatible types in assignment (expression has type "Type[IPRecordingProtocol]", variable has type "Optional[Type[Protocol]]")
src/twisted/pair/test/test_tuntap.py:1372:24: error: Incompatible types in assignment (expression has type "Type[EthernetRecordingProtocol]", variable has type "Optional[Type[Protocol]]")
src/twisted/web/test/test_http.py:15:1: error: Module 'urllib.parse' has no attribute 'clear_cache'  [attr-defined]
    from urllib.parse import urlparse, urlunsplit, clear_cache, parse_qs
Searchable metadata
trac-id__9883 9883
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__1593546044970910 1593546044970910
changetime__1594360403322407 1594360403322407
version__None None
owner__Craig_Rodrigues__rodrigc_____ Craig Rodrigues <rodrigc@...>

@twisted-trac
Copy link
Author

rodrigc's avatar @rodrigc commented

#1328

@twisted-trac
Copy link
Author

rodrigc's avatar @rodrigc commented

Approved here: #1328 (review)

@twisted-trac
Copy link
Author

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

In changeset ab1a7b6

#!CommitTicketReference repository="" revision="ab1a7b674fa74b8219210045d0b918e99356959e"
Merge pull request #1328 from twisted/9883-rodrigc-mypy

[mypy] [9883] Reduce mypy errors

Author: rodrigc
Reviewer: adiroiban
Fixes: ticket:9883

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