Skip to content

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

Closed
@vanheck

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)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions