Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spurious warning about deprecated syntax #2056

Closed
edwardalee opened this issue Oct 14, 2023 · 1 comment · Fixed by #2235
Closed

Spurious warning about deprecated syntax #2056

edwardalee opened this issue Oct 14, 2023 · 1 comment · Fixed by #2235
Assignees
Labels
invalid This doesn't seem right

Comments

@edwardalee
Copy link
Collaborator

The Python test ModalCycleBreaker.lf contains the following syntax in the main reactor:

  test = new TraceTesting(events_size = 1, trace = (  // keep-format
    0,1,0,
    100000000,1,1,
    100000000,1,2,
    100000000,1,3,
    100000000,1,4,
    200000000,1,6,
    100000000,1,7,
    100000000,1,8,
    100000000,1,9
  ), training = False)

This generates the following warning:

lfc: warning: This syntax is deprecated in the Python target, use an equal sign instead of parentheses for assignment.
 --> src/modal_models/ModalCycleBreaker.lf:58:52
   |
57 |   modal = new Modal()
58 |   test = new TraceTesting(events_size = 1, trace = (  // keep-format
   |                                                    ^ This syntax is deprecated in the Python target, use an equal sign instead of parentheses for assignment.
   |
59 |     0,1,0,

lfc: info: Code generation finished.

However, the syntax is correct and up-to-date.

@edwardalee edwardalee added the invalid This doesn't seem right label Oct 14, 2023
@cmnrd
Copy link
Collaborator

cmnrd commented Feb 16, 2024

However, the syntax is correct and up-to-date.

The warning is actually correct. We used to interpret (...) as a list. And if you check the generated code, it converts the (...)expression to a list using Python's [...] syntax. We decided to deprecate this syntax as it is largely misleading. In Python, (...) denotes a tuple, not a list.

I think we should actually follow up and remove this old syntax rule for good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants