Skip to content

fix: quote annotations shadowed by class members - #3654

Merged
mkoura merged 1 commit into
masterfrom
fix_py314_annotation_shadowing
Aug 21, 2026
Merged

fix: quote annotations shadowed by class members#3654
mkoura merged 1 commit into
masterfrom
fix_py314_annotation_shadowing

Conversation

@mkoura

@mkoura mkoura commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

Python 3.14 (PEP 649) evaluates annotations lazily, after the class body has executed, so a class member whose name matches an imported module shadows that module when the annotation is finally resolved, e.g. ClusterManager.cache (property) over the cache module. Sphinx resolving type hints then crashed the doc build with

AttributeError: 'property' object has no attribute 'ClusterManagerCache'

Quote the affected annotations so they resolve in module globals.

Python 3.14 (PEP 649) evaluates annotations lazily, after the class
body has executed, so a class member whose name matches an imported
module shadows that module when the annotation is finally resolved,
e.g. `ClusterManager.cache` (property) over the `cache` module. Sphinx
resolving type hints then crashed the doc build with

    AttributeError: 'property' object has no attribute 'ClusterManagerCache'

Quote the affected annotations so they resolve in module globals.
@mkoura
mkoura requested a review from saratomaz as a code owner August 21, 2026 16:44
@mkoura
mkoura merged commit e700132 into master Aug 21, 2026
3 checks passed
@mkoura
mkoura deleted the fix_py314_annotation_shadowing branch August 21, 2026 16:47
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