Skip to content

update DECORATED_PAGES type annotation#6266

Open
zoumingzhe wants to merge 1 commit intoreflex-dev:mainfrom
bondbox:main
Open

update DECORATED_PAGES type annotation#6266
zoumingzhe wants to merge 1 commit intoreflex-dev:mainfrom
bondbox:main

Conversation

@zoumingzhe
Copy link
Copy Markdown

@zoumingzhe zoumingzhe commented Apr 1, 2026

All Submissions:

  • Have you followed the guidelines stated in CONTRIBUTING.md file?
  • Have you checked to ensure there aren't any other open Pull Requests for the desired changed?

Signed-off-by: Mingzhe Zou <zoumingzhe@qq.com>
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 1, 2026

Greptile Summary

This PR improves type annotations in reflex/page.py by making them more precise and aligned with the actual data structures used at runtime.

  • DECORATED_PAGES type is updated from dict[str, list] to dict[str, list[tuple[Callable, dict[str, Any]]]], which accurately reflects the .append((render_fn, kwargs)) call at line 67.
  • kwargs inside the decorator closure gets an explicit dict[str, Any] annotation instead of being implicitly typed.

Both changes are safe at runtime because from __future__ import annotations (line 3) makes all annotations lazy strings, so the TYPE_CHECKING-only imports of Callable and Any are never evaluated at runtime.

Confidence Score: 5/5

Safe to merge — pure type annotation improvement with no runtime behavior changes.

The changes are annotation-only and fully guarded by from __future__ import annotations, which makes all annotations lazy strings. There are no logic, correctness, or runtime-safety concerns. No P0/P1 issues found.

No files require special attention.

Important Files Changed

Filename Overview
reflex/page.py Improved type annotations for DECORATED_PAGES (from bare list to list[tuple[Callable, dict[str, Any]]]) and kwargs (from untyped {} to dict[str, Any]), both consistent with actual usage at line 67.

Reviews (1): Last reviewed commit: "update DECORATED_PAGES type annotation" | Re-trigger Greptile

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.

1 participant