Skip to content

Conversation

@KyleKing
Copy link
Owner

Replace hardcoded year check (2025) with unconditional warning suppression for PEP 585 deprecation warnings.

Changes:

  • Remove datetime import (no longer needed)
  • Remove hardcoded _PEP585_DATE constant
  • Make warning suppression unconditional (still safe with suppress())
  • Add AttributeError to exception suppression for robustness
  • Add clarifying comments about PEP 585 and removal timeline

Benefits:

  • Fix will not break in 2026 when year > 2025
  • More future-proof and maintainable
  • Clearer intent through documentation
  • No functional change to current behavior

PEP 585 (Python 3.9+) allows list[]/dict[] instead of typing.List[]/typing.Dict[]. The suppression can be removed when the codebase fully migrates to PEP 585 style hints.

Replace hardcoded year check (2025) with unconditional warning
suppression for PEP 585 deprecation warnings.

Changes:
- Remove datetime import (no longer needed)
- Remove hardcoded _PEP585_DATE constant
- Make warning suppression unconditional (still safe with suppress())
- Add AttributeError to exception suppression for robustness
- Add clarifying comments about PEP 585 and removal timeline

Benefits:
- Fix will not break in 2026 when year > 2025
- More future-proof and maintainable
- Clearer intent through documentation
- No functional change to current behavior

PEP 585 (Python 3.9+) allows list[]/dict[] instead of
typing.List[]/typing.Dict[]. The suppression can be removed
when the codebase fully migrates to PEP 585 style hints.
@KyleKing
Copy link
Owner Author

I see why this could be useful, but I'll cross that bridge early next year

@KyleKing KyleKing closed this Nov 22, 2025
@KyleKing KyleKing deleted the claude/fix-runtime-typecheck-date-0164SPN6fj1DYzbYkt1rMYWt branch November 22, 2025 04:08
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.

3 participants