Skip to content

Comments in middle of parethesed code raising errors (jupyterlab - coconut kernel). #851

Closed

Description

@vanheck

I run jupyterlab coconut kernel, and get error if I comment any code in parentheses.

Example 1:

data = [
    "hey",
    # "there", # dont want this value now
    "is comment"
]

raises:

CoconutSyntaxError: unclosed open '[' (line 1)
  data = [    "hey",  # "there",    "is comment"]
         ^
  File <string>:1
SyntaxError: unclosed open '['
  data = [    "hey",  # "there",    "is comment"]

Example 2 - comment function call parameters:

def foo(x, y=1):
    return x + y

foo(
    x=1,
    y=2, # any description - e.g. why this value is 2
)

raises:

CoconutSyntaxError: unclosed open '(' (line 3)
  foo(    x=1,    y=2,  # any description - e.g. why this value is 2)
     ^
  File <string>:3
SyntaxError: unclosed open '('
  foo(    x=1,    y=2,  # any description - e.g. why this value is 2)

Activity

  1. changed the title [-]Comments in middle of parethesed code raising errors (jupyterlab).[/-] [+]Comments in middle of parethesed code raising errors (jupyterlab - coconut kernel).[/+] on Aug 20, 2024
  2. added this to the v3.1.2 milestone on Aug 21, 2024
  3. added a commit that references this issue on Aug 21, 2024
    dd52a7e
  4. evhub commented on Aug 21, 2024

    @evhub
    Owner

    Thanks for the report—should be fixed as of coconut-develop>=3.1.1-post_dev4 (pip install -U coconut-develop>=3.1.1-post_dev4).

  5. added a commit that references this issue on Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions