Skip to content

Replace bare dict type hints with Dict[str, Any]#262

Merged
MasterKale merged 1 commit intoduo-labs:masterfrom
typestring:dict-type-hints
Feb 11, 2026
Merged

Replace bare dict type hints with Dict[str, Any]#262
MasterKale merged 1 commit intoduo-labs:masterfrom
typestring:dict-type-hints

Conversation

@typestring
Copy link
Copy Markdown
Contributor

Added proper dict type hints to prevent type checker complaints in strict mode.

current error example:

Type of "parse_registration_options_json" is partially unknown
  Type of "parse_registration_options_json" is "(json_val: str | dict[Unknown, Unknown]) -> PublicKeyCredentialCreationOptions"

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Oct 12, 2025

CLA assistant check
All committers have signed the CLA.

@MasterKale MasterKale added this to the v2.7.1 milestone Feb 11, 2026
@MasterKale
Copy link
Copy Markdown
Collaborator

MasterKale commented Feb 11, 2026

@typestring Apologies for the delay! Thank you for the PR, I'm a fan of anything that makes type checkers happier.

Can you share what command you're using to run type checking in strict mode? Maybe I can wire up such a CI check to help maintain the strictness of typing in future PRs 🤔

@MasterKale MasterKale merged commit bfdebf4 into duo-labs:master Feb 11, 2026
5 checks passed
@typestring
Copy link
Copy Markdown
Contributor Author

hi, thanks for merging!

i was running pyright in strict mode python -m pyright .
there is no flag to force strict mode afaik so you have to run it with its config file pyrightconfig.json or the config in the pyproject.toml

// pyrightconfig.json
{
  "typeCheckingMode": "strict"
}

// pyproject.toml
[tool.pyright]
typeCheckingMode = "strict"

@MasterKale
Copy link
Copy Markdown
Collaborator

FYI these typing improvements are now available in webauthn==2.7.1

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