-
-
Notifications
You must be signed in to change notification settings - Fork 327
Add type hints #546
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
base: develop
Are you sure you want to change the base?
Add type hints #546
Conversation
|
Your PR was set to target |
|
@sergeyklay can you trigger unittests workflow for the branch, I will update failing tests if any |
|
Please add this!! |
|
it will be awesome if we can have this. |
|
@joke2k do you have time to take a look at this? |
|
This would be really nice! |
|
@joke2k Any update on why this is not merged ? |
|
@joke2k Would be great if this could be merged, currently the package is highlighting a lot of errors in our repositories without this. |
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.
Pull Request Overview
This PR adds type hints to various methods in the Environ class to improve code documentation and IDE support. The changes address issue #533 by providing explicit type annotations for method parameters and return values.
Key changes:
- Added type imports from the
typingmodule includingUnion,TypeVar,List,Tuple, andDict - Added type hints to method signatures for
str,bytes,bool,int,float,list,tuple,dict,url, and various URL parsing methods - Specified return types and parameter types using Union types to handle both actual values and
NoValuesentinel
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
| channels = channels_url | ||
|
|
||
| def path(self, var, default=NOTSET, **kwargs): | ||
| def path(self, var, default: Union['Path', NoValue] = NOTSET, **kwargs) -> 'Path': |
Copilot
AI
Aug 17, 2025
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.
Using string quotes for forward references ('Path') is unnecessary here since the Path class is already defined in the codebase. Consider using Union[Path, NoValue] instead of Union['Path', NoValue].
| def path(self, var, default: Union['Path', NoValue] = NOTSET, **kwargs) -> 'Path': | |
| def path(self, var, default: Union[Path, NoValue] = NOTSET, **kwargs) -> Path: |
|
@joke2k do you want me to update code as per copilot comments? |

Description