Skip to content

Commit

Permalink
Merge pull request #280 from TTsangSC/issue-279
Browse files Browse the repository at this point in the history
Added support for annotated assignments in the static parser
  • Loading branch information
Erotemic authored Jun 24, 2024
2 parents c715356 + ddf3fec commit 13bf68f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions line_profiler/autoprofile/util_static.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,10 @@ def visit_Assign(self, node):
if getattr(target, "id", None) == varname:
self.static_value = _parse_static_node_value(node.value)

def visit_AnnAssign(self, node):
if getattr(node.target, "id", None) == varname:
self.static_value = _parse_static_node_value(node.value)

visitor = StaticVisitor()
visitor.visit(pt)
try:
Expand Down

0 comments on commit 13bf68f

Please sign in to comment.