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

Not Removing Comments in code Version: 1.66.0 - in .py files #25

Open
rohan-paul opened this issue Apr 2, 2022 · 3 comments
Open

Not Removing Comments in code Version: 1.66.0 - in .py files #25

rohan-paul opened this issue Apr 2, 2022 · 3 comments

Comments

@rohan-paul
Copy link

Version: 1.66.0
Commit: e18005f0f1b33c29e81d732535d8c0e47cafb0b5
Date: 2022-03-30T05:50:41.156Z
Electron: 17.2.0
Chromium: 98.0.4758.109
Node.js: 16.13.0
V8: 9.8.177.11-electron.0
OS: Linux x64 5.13.0-39-generic

@rohan-paul rohan-paul changed the title Not Removing Comments in code Version: 1.66.0 Not Removing Comments in code Version: 1.66.0 - in .py files Apr 2, 2022
@rioj7
Copy link

rioj7 commented Apr 10, 2022

It looks like this is no longer maintained and it can only handle 1 type of line and block comment.

There is an alternative extensions that removes comments and it should work for .py files: Remove Comments

@rohan-paul
Copy link
Author

It looks like this is no longer maintained and it can only handle 1 type of line and block comment.

There is an alternative extensions that removes comments and it should work for .py files: Remove Comments

Thanks for the suggestion, and I installed that one, however, even that one seems not to work as expected.

e.g. I have the following python code in .py file. And I just could not delete the multi-line comments using that extension.

def weights_init_normal(m):
    """
    In the example above, we've described the input image in terms of its latent attributes using a single value to describe each attribute. 
    """
    classname = m.__class__.__name__
    if classname.find("Conv") != -1:
        torch.nn.init.normal_(m.weight.data, 0.0, 0.02)
    elif classname.find("BatchNorm2d") != -1:
        torch.nn.init.normal_(m.weight.data, 1.0, 0.02)
        torch.nn.init.constant_(m.bias.data, 0.0)

@rioj7
Copy link

rioj7 commented Apr 11, 2022

@rohan-paul Because it is not a comment, it is a documentation string, use the # character if you write comments

Python does not have Multi Line comments, """ and ''' are multi line strings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants