Skip to content

Conversation

@yashwanthatla
Copy link
Owner

@yashwanthatla yashwanthatla commented Jun 21, 2025

PR Summary

Add evaluate_forward_ref function and rename Format.SOURCE to Format.STRING

Overview

This PR adds the evaluate_forward_ref function to typing_extensions and renames the Format enum value from SOURCE to STRING to align with the actual implementation. It includes comprehensive tests for the new functionality and updates all references to the renamed enum value.

Change Types

Type Description
Feature Add evaluate_forward_ref function to public API
Bugfix Rename Format.SOURCE to Format.STRING for consistency
Test Add TestEvaluateForwardRefs test class

Affected Modules

Module / File Change Description
typing_extensions.py Add evaluate_forward_ref function with backward compatibility
typing_extensions.py Rename Format.SOURCE to Format.STRING in enum and documentation
typing_extensions.py Add compatibility flag _FORWARD_REF_HAS_CLASS
test_typing_extensions.py Update all references from Format.SOURCE to Format.STRING
test_typing_extensions.py Add tests for evaluate_forward_ref function

Notes for Reviewers

  • The implementation includes backward compatibility for different Python versions
  • The evaluate_forward_ref function is now exposed in the public API via __all__
  • All tests have been updated to use Format.STRING instead of the previous Format.SOURCE

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