this post was submitted on 21 Nov 2024
277 points (90.4% liked)
Programmer Humor
32557 readers
129 users here now
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
- Posts must be relevant to programming, programmers, or computer science.
- No NSFW content.
- Jokes must be in good taste. No hate speech, bigotry, etc.
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
This isn't standard python.
lib
is not in the standard library. Python also doesn't have any special variables where it stores comments, other than__doc__
which stores a docstring. If I had to guess,add
is reading the file/REPL via__file__
.Is __doc__ storing a comment or just a text string?
It's a string, although sometimes Python conflates the two. The recommended way to make a multi-line comment is to just make a multi-line string and just don't use it.