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

t.l.Logger reports wrong return type for __get__ #10119

Closed
twisted-trac opened this issue Mar 8, 2021 · 4 comments
Closed

t.l.Logger reports wrong return type for __get__ #10119

twisted-trac opened this issue Mar 8, 2021 · 4 comments

Comments

@twisted-trac
Copy link

jchristgit's avatar @jchristgit reported
Trac ID trac#10119
Type defect
Created 2021-03-08 15:34:48Z

twisted.logger.Logger.__get__ currently specifies its return type as
object, which messes up mypy's typechecking when used as part of a class:

from twisted.logger import Logger


class Foo:
    log = Logger()

    def run(self) -> None:
        self.log.info("Hello!")
$ mypy test.py
mptest.py:8: error: "object" has no attribute "info"
Searchable metadata
trac-id__10119 10119
type__defect defect
reporter__jchristgit jchristgit
priority__normal normal
milestone__None None
branch__ 
branch_author__ 
status__closed closed
resolution__fixed fixed
component__logger logger
keywords__None None
time__1615217688789927 1615217688789927
changetime__1615226512424913 1615226512424913
version__None None
owner__jchristgit jchristgit

@twisted-trac
Copy link
Author

jchristgit's avatar @jchristgit commented

See [https://github.com//pull/1541]

@twisted-trac
Copy link
Author

wsanchez's avatar @wsanchez set owner to @jchristgit

@twisted-trac
Copy link
Author

wsanchez's avatar @wsanchez set status to closed

@twisted-trac
Copy link
Author

glyph's avatar @glyph commented

This was closed in f93f647

Removing review keyword since Thomas forgot to do it.

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