Skip to content

Update pubsub_client.py#6564

Open
Iaw4tch wants to merge 1 commit into
flet-dev:mainfrom
Iaw4tch:fix-pubsub-callable-annotation
Open

Update pubsub_client.py#6564
Iaw4tch wants to merge 1 commit into
flet-dev:mainfrom
Iaw4tch:fix-pubsub-callable-annotation

Conversation

@Iaw4tch

@Iaw4tch Iaw4tch commented Jun 8, 2026

Copy link
Copy Markdown

Description

By default Pylance handles Callable as (...) -> Unknown. This is a minor fix for avoiding a reportUnknownMemberType error

Test code

I wrote such string:

self.page.pubsub.subscribe_topic("emphasis_hue", self._subscription_wrapper)

end ended up with Pylance error:

Type of "subscribe_topic" is partially unknown
Type of "subscribe_topic" is "(topic: str, handler: (...) -> Unknown) -> None" Pylance[reportUnknownMemberType]

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist

  • I signed the CLA.
  • I have performed a self-review of my own code.
  • My code follows the style guidelines of this project.
  • I have commented my code, particularly in hard-to-understand areas.
  • My changes generate no new warnings.
  • New and existing tests pass locally with my changes.
  • I have made corresponding documentation changes, if applicable.
  • I have added changelog entries for user-facing changes, if applicable.
  • I have updated release guide pages and website/sidebars.yml for breaking changes, removals, and deprecations, if applicable.

Summary by Sourcery

Bug Fixes:

  • Specify concrete Callable signatures for pubsub subscription handlers to resolve Pylance reportUnknownMemberType diagnostics.

By default Pylance handles Callable as (...) -> Unknown. This is a minor fix for avoiding a reportUnknownMemberType error
@CLAassistant

CLAassistant commented Jun 8, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We've reviewed this pull request using the Sourcery rules engine

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.

2 participants