-
Notifications
You must be signed in to change notification settings - Fork 954
Conversation
Before this change, trailing comments in pure functions were stripped on load. That meant that a function
def f():
# BEGIN YOUR CODE
...
# END YOUR CODE
was incorrectly parsed as
# BEGIN YOUR CODE
...
on load. That meant that a function
```
@app.function
def f():
# BEGIN YOUR CODE
...
# END YOUR CODE
```
was incorrectly parsed as
```
def f():
# BEGIN YOUR CODE
...
```
This change preserves the trailing comment(s).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| class MyClass: | ||
| def method(self): | ||
| pass | ||
| # trailing class comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good check
| assert "# comment 2" in notebook.cells[0].code | ||
|
|
||
| @staticmethod | ||
| def test_function_without_trailing_comment() -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think we have other tests for this, but we do need one for setup_cell
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checking comments after return might be unexpected though (especially if we do change extract_from_code)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a setup cell test
84e49bb to
95e76b9
Compare
|
Development release published. You may be able to view the changes at https://marimo.app?v=0.19.5-dev10 |