Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use get_typing_hints instead of __annotations__ to resolve types in P…
…ython 3.10 (#297) Summary: **What:** Fixes #296 **Why:** Due to PEP 563 becoming default in Python 3.10 the `__annotations__` value doesn't store types and it stores string values. Using `typing.get_type_hints` ensures the types are evaluated and returned like behavior before Python 3.10 . **How:** **Risks:** **Checklist**: <!-- Have you done all of these things? To check an item, place an "x" in the box like so: "- [x] Tests" Add "N/A" to the end of each line that's irrelevant to your changes --> - [ ] Added tests, if you've added code that should be tested - [ ] Updated the documentation, if you've changed APIs - [ ] Ensured the test suite passes - [ ] Made sure your code lints - [ ] Completed the Contributor License Agreement ("CLA") Pull Request resolved: #297 Reviewed By: lsiudut Differential Revision: D27645783 Pulled By: deathowl fbshipit-source-id: eb1d41abcccad9e5d6cc92554472e0d083bebf4f
- Loading branch information