Conversation
Summary of ChangesHello @CyanM0un, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a specific bug in the AST visitor for Python, where the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
This PR is being reviewed by Cursor Bugbot
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
| False, | ||
| UNode.DynamicType(UNode.SourceLocation(), UNode.Meta()))) | ||
| if keyword.id.name is None: | ||
| keyword.id.name = "kwargs" |
There was a problem hiding this comment.
Keyword expansion loses argument identity
Medium Severity
When node.arg is None, visit_keyword rewrites every expanded keyword to the fixed name kwargs. This makes distinct ** expansions and real kwargs= arguments indistinguishable in CallExpression.arguments, so downstream argument binding can merge or misattribute parameters.
There was a problem hiding this comment.
Code Review
This pull request addresses a bug where **kwargs in a function call resulted in a None name in the UAST. The proposed fix correctly identifies this case and assigns a default name, "kwargs". My review provides a suggestion to enhance this by using the actual variable name from the ** expansion when available, which will produce a more precise UAST and prevent potential name conflicts.
| False, | ||
| UNode.DynamicType(UNode.SourceLocation(), UNode.Meta()))) | ||
| if keyword.id.name is None: | ||
| keyword.id.name = "kwargs" |
There was a problem hiding this comment.
Hardcoding the name to "kwargs" for ** expansions can be problematic. It loses the actual name of the dictionary being expanded and can cause name collisions if a function call uses multiple ** expansions (e.g., f(**dict1, **dict2)), which is valid in Python 3.5+. A better approach is to use the name of the variable being expanded if it's a simple name, and fall back to "kwargs" for more complex expressions.
| keyword.id.name = "kwargs" | |
| if isinstance(node.value, ast.Name): | |
| keyword.id.name = node.value.id | |
| else: | |
| keyword.id.name = "kwargs" |


Note
Low Risk
Small, localized AST-to-UAST tweaks; risk is limited to potential behavioral differences in constructor return emission and
**kwargsargument naming.Overview
Fixes Python UAST generation for two edge cases.
When visiting call
keywordnodes wherenode.argisNone(i.e.,**kwargsexpansion), the transformer now assigns a stable identifier name ("kwargs") instead of leaving it null. For__init__functions, it now appends an implicitreturn selfonly if the body is non-empty and does not already end with aReturnStatement, avoiding duplicate returns.Written by Cursor Bugbot for commit 59e7590. This will update automatically on new commits. Configure here.