Skip to content

fix type hints for Query properties#439

Open
unawarez wants to merge 1 commit intotree-sitter:masterfrom
unawarez:patch-1
Open

fix type hints for Query properties#439
unawarez wants to merge 1 commit intotree-sitter:masterfrom
unawarez:patch-1

Conversation

@unawarez
Copy link

@unawarez unawarez commented Feb 8, 2026

Query's pattern_count, capture_count, and string_count are properties, but @property was missing in the type stub file. Before this change, the following code succeeded at runtime but failed type checking:

    print(int(query.string_count))
    print(int(query.capture_count))
    print(int(query.pattern_count))

`Query`'s `pattern_count`, `capture_count`, and `string_count` are properties, but `@property` was missing in the type stub file. Before this change, the following code succeeded at runtime but failed type checking:
```
    print(int(query.string_count))
    print(int(query.capture_count))
    print(int(query.pattern_count))
```
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