-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Type hints: utils
module
#1707
Type hints: utils
module
#1707
Conversation
…ed with type definitions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like get_sorted_request_variable
needs a type hint as well.
debug_toolbar/stubs.py
Outdated
@@ -0,0 +1,24 @@ | |||
from typing import Any, List, NamedTuple, Optional, Tuple | |||
|
|||
from django import template as dj_template |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@matthiask Admittedly I haven't done typing in a project of my own that requires a stubs file. I'm unsure how I feel about a single stub file without docs or some way to determine if they're used someplace. However, I think I'm okay with us using this until we find it doesn't work.
Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm good with these changes, but want to see if we need a discussion regarding stubs.py before merging.
I'm only wondering if the module should be renamed to Apart from that I have to admit that I haven't used typing on real world projects yet. I have played around with mypy a bit but that's all, so I can't really say if these changes make sense or not. FWIW I approve this pull request as well :) |
@leandrodesouzadev could you make the changes Matthias outlined? I think they're worthwhile. |
@tim-schilling I just pushed a new commit with the changes outlined by @matthiask. |
Thanks! |
You can just check guys how the types are added into other libraries |
typing: Adds type hints to the
utils
module. Astubs
file was added with type definitions.Partial implementation of #1705.