-
Notifications
You must be signed in to change notification settings - Fork 482
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
[Typing] Using Sequence instead of list #3661
Conversation
Reviewer's Guide by SourceryThis pull request refactors the type annotations in various files to use File-Level Changes
Tips
|
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.
Hey @zrr1999 - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 6 issues found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.
sdk/python/packages/flet-core/src/flet_core/navigation_drawer.py
Outdated
Show resolved
Hide resolved
Thanks for your contribution. |
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.
Thanks for your contribution!
I pushed a review commit. Please modify the other files following this example.
- we cast to a list in the setter (not in the init)
self.__controls = list(value) if value is not None else []
: when the setter looks like this (or similar), the getter should have a return type of list
Okay, I have finished making the changes. |
sdk/python/packages/flet-core/src/flet_core/cupertino_segmented_button.py
Show resolved
Hide resolved
sdk/python/packages/flet-core/src/flet_core/cupertino_sliding_segmented_button.py
Show resolved
Hide resolved
sdk/python/packages/flet-core/src/flet_core/cupertino_segmented_button.py
Outdated
Show resolved
Hide resolved
sdk/python/packages/flet-core/src/flet_core/cupertino_sliding_segmented_button.py
Outdated
Show resolved
Hide resolved
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.
Thanks for the changes, LGTM.
Description
Fixes #3660
Test Code
Type of change
Checklist:
Screenshots (if applicable):
Additional details
Summary by Sourcery
This pull request updates the type hints for 'controls' parameters from List[Control] to Sequence[Control] in various components to enhance flexibility in input types.