capability is fine. Conflation is stupid. You can also use code to erase itself, but thinking that’s a good idea is generally wrong. But to remove that, you also remove the general ability to erase files.
capability is fine. Conflation is stupid. You can also use code to erase itself, but thinking that’s a good idea is generally wrong. But to remove that, you also remove the general ability to erase files.
Sure, but let’s just clarify that this is someone going out of their way to create this problem, using Python’s ability to read it’s own code.
Basically, you can load any text file, including a source code file, and do whatever you want with it.
So, a function can be written that finds out whatever’s calling it, reads that file, parses the comments, and uses them as values. This can also be done with introspection, using the same mechanism that displays tracebacks.
Yeah. ‘lib’ isn’t a standard Python library, it’s the name of the abomination that this person created. Since python has quite a bit of useful introspection, they can do something like:
abomination.add()
Now, I don’t know if python keeps the comments around, so it may involve getting the filename and line number, reading the file, and manually extracting the comment text from that line.