Skip to content

Conversation

pantheraleo-7
Copy link
Contributor

merge after #101 is merged.

based on #101(comment)

@pantheraleo-7
Copy link
Contributor Author

Just realised, this is present in many libraries. An automated patch might be a better approach than manual PRs.

Automating quoting the symbols might be error prone, so adding this import should do the [same] job:
from __future__ import annotations

This enables lazy evaluation of type annotations in Python 3.7+

@pantheraleo-7 pantheraleo-7 force-pushed the type-hint-forward-reference branch from 3f215d5 to 147ca85 Compare October 7, 2025 17:39
@pantheraleo-7 pantheraleo-7 changed the title change to forward reference for possibly unbound objects in type hint(s) change to forward reference for possibly unbound symbols in type hint(s) Oct 7, 2025
@FoamyGuy
Copy link
Contributor

FoamyGuy commented Oct 8, 2025

using from __future__ import annotations might be easier than trying to update things to use quoted references. I think we added that as an import in the core that exists to make it compatible with that behavior.

We can try searching in the bundle to find ones that have this stuff in the except block of their guarded typing import.

@pantheraleo-7
Copy link
Contributor Author

The PR on INA219 is required because it removes the I2C = None thing. But this PR becomes optional, as I2C = None already got removed by #101, if you intend to include the from __future__ import annotations import via an automated script/method.

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.

2 participants