-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Output specified letter groups in --list #21
Conversation
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 left some comments, I hope you don't mind doing some changes.
(clicked approve by mistake, sorry for the confusion)
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 left some comments, I hope you don't mind doing some changes.
I updated the comments, as the suggestion to use |
for more information, see https://pre-commit.ci
Thanks for the suggestions from both of you! I pushed some new commits according to the requested changes. However, for the comparison part in I also tested on some pseudo-code in Python shell. >>> a = ['x', 'y', 'z']
>>> if a is True:
... print('foo')
...
>>> if a:
... print('bar')
...
bar |
Yeah, the suggestion was that we could use |
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 left a comment regarding an unnecesary if statement, but this looks good!
timezone_converter/list_view.py
Outdated
def _sort_and_group(self) -> DefaultDict[str, List[str]]: | ||
sorted_timezones = dict(sorted(self.timezone_translations.items())) | ||
longest_name = len(max(sorted_timezones, key=lambda x: len(x))) | ||
timezone_groups: DefaultDict[str, List[str]] = defaultdict(list) | ||
for tz_name in sorted_timezones: | ||
timezone_groups[tz_name[0]].append(tz_name.center(longest_name)) | ||
if self.letters: |
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.
This if statement is not necessary, as we are using list(string.ascii_lowercase)
as a value for const
in main.py.
I seems that I always forget that the request changes button exists, sorry about that. Please @Badboy-16 , take a look at the comment about the unnecessary if statement. When that is fixed this will be ready to be merged! |
Have just removed the |
Thanks again for your time and for this contribution! I'll create a new release in a bit |
Trying to fix #19
Usage: