Convert Python codegen templates from py2 to py3 style annotations#450
Closed
aaron-skydio wants to merge 1 commit intomainfrom
Closed
Convert Python codegen templates from py2 to py3 style annotations#450aaron-skydio wants to merge 1 commit intomainfrom
aaron-skydio wants to merge 1 commit intomainfrom
Conversation
Update jinja templates to generate Python 3-style inline type annotations instead of Python 2-style comment annotations (# type: ...). Changes: - Update function_declaration macro in util.jinja to use inline annotations - Add `from __future__ import annotations` to all Python templates for postponed annotation evaluation (PEP 563) - Convert all method signatures in geo_package/CLASS.py.jinja and cam_package/CLASS.py.jinja to py3-style - Update custom_methods templates (rot2, rot3, pose2, pose3, unit3) - Update ops templates (group_ops, lie_group_ops, camera_ops) - Format function parameters with 4-space indentation, no trailing comma - Remove unnecessary blank lines before "# Total ops:" comments - Order ruff noqa comments before future imports 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Topic: py3-annotations
Member
Author
|
Reviews in this chain: |
Member
Author
486f6eb to
cbbc146
Compare
asa
pushed a commit
to asa/symforce
that referenced
this pull request
Jan 23, 2026
…style annotations Convert Python codegen templates from py2 to py3 style annotations Update jinja templates to generate Python 3-style inline type annotations instead of Python 2-style comment annotations (# type: ...). Changes: - Update function_declaration macro in util.jinja to use inline annotations - Add `from __future__ import annotations` to all Python templates for postponed annotation evaluation (PEP 563) - Convert all method signatures in geo_package/CLASS.py.jinja and cam_package/CLASS.py.jinja to py3-style - Update custom_methods templates (rot2, rot3, pose2, pose3, unit3) - Update ops templates (group_ops, lie_group_ops, camera_ops) - Format function parameters with 4-space indentation, no trailing comma - Remove unnecessary blank lines before "# Total ops:" comments - Order ruff noqa comments before future imports 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Topic: py3-annotations Closes symforce-org/symforce#450 GitOrigin-RevId: d27b96fcae23ce65bdc4a7863ac84f10a9fbdc50
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Update jinja templates to generate Python 3-style inline type annotations
instead of Python 2-style comment annotations (# type: ...).
Changes:
from __future__ import annotationsto all Python templates forpostponed annotation evaluation (PEP 563)
cam_package/CLASS.py.jinja to py3-style
🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com
Topic: py3-annotations