this post was submitted on 21 Nov 2024
192 points (97.5% liked)
Programmer Humor
32533 readers
761 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
You should look at how OPs example works first maybe
The python interpreter isn't parsing comments, the add() function is just getting the current line number from the call stack context, and using a regex to spit out the numbers to the right of the "#" on the current executing line of the source code.
Yeah fair I was just assuming this was standard library, I see your point now.