这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@rolandwalker
Copy link
Contributor

@rolandwalker rolandwalker commented Jul 26, 2025

Description

  • add typehints
  • import annotations for Python 3.9 compatibility
  • remove OrderedDict as we no longer support old Pythons
  • correct "pgexecute" comment
  • reformat some long type signatures
  • bugfix: check that server_info is not None before invoking a method on it
  • force a list() on COMMANDS.keys() in completion_refresher.py
  • check type of func_data before calling extend() directly
  • set the empty string if set_dbname() is called with None
  • update the changelog to express that typehinting is mostly done

Checklist

  • I've added this contribution to the changelog.md.
  • I've added my name to the AUTHORS file (or it's already there).
  • I ran uv ruff check && uv ruff format to lint and format the code.

@rolandwalker rolandwalker self-assigned this Jul 26, 2025
@rolandwalker rolandwalker requested a review from amjith July 26, 2025 23:08
@rolandwalker rolandwalker force-pushed the RW/typehint-completion-refresher branch 3 times, most recently from d078199 to a90c457 Compare July 27, 2025 01:23
@rolandwalker rolandwalker removed the request for review from amjith July 27, 2025 01:24
@rolandwalker rolandwalker changed the title Typehint completetion_refresher.py Typehint completion_refresher.py Jul 27, 2025
 * add typehints
 * import annotations for Python 3.9 compatibility
 * remove OrderedDict as we no longer support old Pythons
 * correct "pgexecute" comment
 * reformat some long type signatures
 * bugfix: check that server_info is not None before invoking a method
   on it
 * force a list() on COMMANDS.keys() in completion_refresher.py
 * check type of func_data before calling extend() directly
 * set the empty string if set_dbname() is called with None
 * update the changelog to express that typehinting is mostly done
@rolandwalker rolandwalker force-pushed the RW/typehint-completion-refresher branch from a90c457 to 9f79b06 Compare July 27, 2025 01:52
@rolandwalker rolandwalker requested a review from amjith July 27, 2025 01:53

class CompletionRefresher:
refreshers = OrderedDict()
refreshers: dict = {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing from OrderedDict to Dict didn't change behavior?

I'm trying to remember why this was an OrderedDict to begin with.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It shouldn't change behavior because dict is ordered after Python 3.7. There are some small differences with OrderedDict per https://docs.python.org/3/library/collections.html#collections.OrderedDict , but one difference is that dict is supposed to be more performant for the common case.

@rolandwalker rolandwalker merged commit be90492 into main Jul 28, 2025
13 of 14 checks passed
@rolandwalker rolandwalker deleted the RW/typehint-completion-refresher branch July 28, 2025 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants