Skip to content

Unintended inline code comment savings #473

@yifanwu

Description

@yifanwu

Your code:

This was running the most recent version of Lineapy (at time of posting) on Python 3.9.

a = 1 # test
b = a + 1
import lineapy
b_art = lineapy.save(b, "b art")

Then b_art.code would return

a = 1 # test
b = a + 1

Issue: We had thought that all comments are excluded and I'm a little surprised that inline comments were even included. We should gather requirements around user needs for comments and create a more intentional experience.

I suspect that it has something to do with how inline comments could be use for type annotations (e.g., type-ignore) but I haven't investigated further yet. We should also add test cases so we make sure that different python versions behave the same way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions