Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TypedDict versions of _Details type hint #128

Merged
merged 6 commits into from
Jul 25, 2021
Merged

Add TypedDict versions of _Details type hint #128

merged 6 commits into from
Jul 25, 2021

Commits on Jul 14, 2021

  1. Configuration menu
    Copy the full SHA
    36ba667 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d557a26 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d1fa8ee View commit details
    Browse the repository at this point in the history
  4. Use TypedDict dummy in place of recasts

    Mypy's --allow-redefinition flag does not yet work with classes. There are workarounds that trick Mypy, but this leaves Pylance with a Union between Dict[str, Any] and the actual TypedDict subclass, which makes any function annotated with this type incompatible with the required handler signature.
    
    This solution always uses the TypedDict subclass, but reassigns the TypedDict name to equal the featureless "object" instead. That way inheritance works as intended and no typing_extensions dependency is required.
    leonhard-s committed Jul 14, 2021
    Configuration menu
    Copy the full SHA
    36f0e1f View commit details
    Browse the repository at this point in the history

Commits on Jul 17, 2021

  1. Revert "Use TypedDict dummy in place of recasts"

    This reverts commit 36f0e1f.
    leonhard-s committed Jul 17, 2021
    Configuration menu
    Copy the full SHA
    cd50fbe View commit details
    Browse the repository at this point in the history
  2. Revert to single-dict type with optional keys

    The additional mixed-in types added too much complexity and maintenance effort while still requiring the user to be aware of use-case specific keys.
    leonhard-s committed Jul 17, 2021
    Configuration menu
    Copy the full SHA
    e0cd03e View commit details
    Browse the repository at this point in the history