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

Add type annotations to __repr__() and __str__() #9918

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

Add type annotations to __repr__() and __str__() #9918

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

Comments

@twisted-trac
Copy link

mthuurne's avatar @mthuurne reported
Trac ID trac#9918
Type enhancement
Created 2020-07-18 23:03:17Z

These two methods always return str, so it's easy to add type annotations for them with a simple text substitution over the entire source tree.

However, since mypy will check the body of annotated methods, this means mypy coverage grows and that we'll have to fix some method bodies as a result.

I have already fixed the fallout in a sloppy way; I'll push a PR in a few days when it's cleaned up.

Searchable metadata
trac-id__9918 9918
type__enhancement enhancement
reporter__mthuurne mthuurne
priority__normal normal
milestone__publish_types publish types
branch__ 
branch_author__ 
status__closed closed
resolution__fixed fixed
component__core core
keywords__review review
time__1595113397389803 1595113397389803
changetime__1595442775043567 1595442775043567
version__None None
owner__mthuurne mthuurne

@twisted-trac
Copy link
Author

mthuurne's avatar @mthuurne commented

PR is ready for review: #1360

@twisted-trac
Copy link
Author

rodrigc's avatar @rodrigc set owner to @mthuurne

Approved: #1360 (review)

@twisted-trac
Copy link
Author

mthuurne's avatar @mthuurne set status to closed

In changeset 12a3faf

#!CommitTicketReference repository="" revision="12a3faf9a2ec226be5414549f33cb047bb377253"
Merge pull request #1360 from twisted/9918-mthuurne-annotate_repr_str

Add type annotations to __repr__() and __str__()

Author: mthuurne
Reviewer: rodrigc
Fixes: ticket:9918

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