Skip to content

Conversation

@sirosen
Copy link
Member

@sirosen sirosen commented Jan 7, 2026

scope_requirements was annotated as dict in init for ClientApp, but
the base class, UserApp, and the add_scope_requirements method all
accept a Mapping -- allowing for an immutable mapping type.

To confirm the fix, the typing test which currently checks the scope
requirements type of app objects is expanded to cover

  • both UserApp and ClientApp
  • add_scope_requirements and __init__
  • a dict which is a subtype of Mapping[K, V] but not of dict[K, V]
    (for our specific K, V) and a types.MappingProxyType (an immutable
    dict proxy)

fixes #1358

`scope_requirements` was annotated as `dict` in init for `ClientApp`, but
the base class, `UserApp`, and the `add_scope_requirements` method all
accept a `Mapping` -- allowing for an immutable mapping type.

To confirm the fix, the typing test which currently checks the scope
requirements type of app objects is expanded to cover
- both UserApp and ClientApp
- `add_scope_requirements` and `__init__`
- a `dict` which is a subtype of `Mapping[K, V]` but not of `dict[K, V]`
  (for our specific `K, V`) and a `types.MappingProxyType` (an immutable
  dict proxy)

fixes globus#1358
@sirosen sirosen force-pushed the fix-typing-strictness-bug branch from 95be8ba to 91837ea Compare January 7, 2026 01:40
@sirosen sirosen merged commit 29e67c7 into globus:main Jan 7, 2026
7 checks passed
@sirosen sirosen deleted the fix-typing-strictness-bug branch January 7, 2026 17:44
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.

ClientApp(scope_requirements) has type dict

2 participants