DEV Community

Discussion on: multiline comment in python

Collapse
 
paddy3118 profile image
Paddy3118

Unfortunately you have it wrong. Python has a multi-line string that can be misused as you describe, but it is best to not use them on code you want to keep.
It makes source harder to read and an automated linter may correctly flag it as a statement that has no effect and so should be removed.
If you really want it as a comment then comment each line individually (your editor might even make easy).
For throw-away code, then who cares, it won't be kept, yes?

Collapse
 
maxwizardth profile image
oladejo abdullahi

thanks for your contribution,I get it! but actually if you try to understand my description well I am not saying one should use it to keep a codes for so long. but sometimes you might not really satisfied with the codes you have written and not sure if the other way you think will work or not then you can comment out the unsatisfied codes and start a new one. if new one worked then you can totally remove the old codes otherwise remove the new code and don't comment out the old code again.