| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
📝 Walkthrough
WalkthroughThe SymbolTableBuilder::scan_statement handling for FunctionDef now saves/restores the current scope's annotation_block for Function and AsyncFunction in addition to Class and Module, extending annotation scope preservation to function definitions. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem🚥 Pre-merge checks | ✅ 2 | ❌ 1 ❌ Failed checks (1 warning)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
No actionable comments were generated in the recent review. 🎉 Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. ❤️ ShareComment @coderabbitai help to get the list of available commands and usage tips. |
Sorry, something went wrong.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agentsIn `@crates/codegen/src/symboltable.rs`: - Around line 1137-1142: The matches expression that sets should_save_annotation_block currently checks parent_scope_typ for CompilerScope::Class, ::Module, and ::Function but omits CompilerScope::AsyncFunction; update the matches to include Some(CompilerScope::AsyncFunction) so async functions are treated the same as normal functions when deciding to save/restore annotation blocks (referencing the local variables should_save_annotation_block and parent_scope_typ in symboltable.rs).
Sorry, something went wrong.
For example in the following code:
def foo(x: int, y: float):
def bar(q: int):
return q
pass
Make sure that `foo` type annotations are correctly propogated to
it's `__annotate__` and `__annotations__` attributes.
With this chage, we'll get:
>>>>> foo.__annotations__
{'x': <class 'int'>, 'y': <class 'float'>}
Previously annotations where 'lost', and we would get:
>>>>> foo.__annotations__
{}
📦 Library DependenciesThe following Lib/ modules were modified. Here are their dependencies: [ ] lib: cpython/Lib/typing.py dependencies:
dependent tests: (10 tests)
Legend:
|
Sorry, something went wrong.
There was a problem hiding this comment.
👍 Thank you!
Sorry, something went wrong.
For example in the following code:
def foo(x: int, y: float):
def bar(q: int):
return q
pass
Make sure that `foo` type annotations are correctly propogated to
it's `__annotate__` and `__annotations__` attributes.
With this chage, we'll get:
>>>>> foo.__annotations__
{'x': <class 'int'>, 'y': <class 'float'>}
Previously annotations where 'lost', and we would get:
>>>>> foo.__annotations__
{}
| Back | FazBrowse Home | New Git URL |
For example in the following code:
def foo(x: int, y: float): def bar(q: int): return q passMake sure that foo type annotations are correctly propogated to it's __annotate__ and __annotations__ attributes.
With this chage, we'll get:
>>>>> foo.__annotations__ {'x': <class 'int'>, 'y': <class 'float'>}Previously annotations where 'lost', and we would get:
>>>>> foo.__annotations__ {}Summary by CodeRabbit