Skip to content

Fix invalid **kwargs type annotation in Authenticate constructor - #296

Open
pctablet505 wants to merge 1 commit into
mkhorasani:mainfrom
pctablet505:fix-kwargs-type-annotation
Open

Fix invalid **kwargs type annotation in Authenticate constructor#296
pctablet505 wants to merge 1 commit into
mkhorasani:mainfrom
pctablet505:fix-kwargs-type-annotation

Conversation

@pctablet505

Copy link
Copy Markdown

Summary

Authenticate.__init__ annotates **kwargs as Optional[Dict[str, Any]]. That's not a valid way to type **kwargs — the annotation on a **kwargs parameter describes the type of each individual value passed in, not the aggregated dict. The correct annotation here is Any.

Change

-            **kwargs: Optional[Dict[str, Any]]
+            **kwargs: Any

Verified with mypy that this actually removes several spurious downstream errors in the same file (e.g. at the time.sleep(...) call sites) that were caused by kwargs being mistyped, with no new errors introduced.

Closes #287

**kwargs was annotated as Optional[Dict[str, Any]], which incorrectly
types the whole kwargs mapping rather than the type of each value.
The correct annotation for **kwargs is Any (the type of each keyword
argument's value), not a Dict wrapper.

Fixes mkhorasani#287
@pctablet505
pctablet505 marked this pull request as ready for review July 17, 2026 12:46
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.

Possible incorrect type annotation for **kwargs in the Authenticate constructor.

1 participant