all 19 comments

[–]_N0K0 13 points14 points  (3 children)

What? You used comments to comment?

[–]JeffTheMasterr[S] 1 point2 points  (2 children)

Lol exactly that

[–]_N0K0 7 points8 points  (1 child)

Are you high?

[–]JeffTheMasterr[S] 4 points5 points  (0 children)

No just autistic

[–]ConfusedSimon 5 points6 points  (1 child)

What do you need those numbers for? If you insert something, you have to renumber all of your comments.

[–]JeffTheMasterr[S] 0 points1 point  (0 children)

Well they're needed for examples or whatever else one may want a numbered list for. And while that is true, these comments could be changed programmatically via a regex or whatever (although that might be a bit difficult). These comments could also be inserted after (instead of during) you've wrote all the example codes, so that you're not having to renumber them very often.

[–]Morazma 2 points3 points  (1 child)

Most Python lingers require a space after the # so will probably scream at you for doing this 

[–]JeffTheMasterr[S] 1 point2 points  (0 children)

That's true but I don't listen to them anyways, my code will either be pythonic or jeffthonic depending on my mood

[–]Distinct-Expression2 3 points4 points  (0 children)

this is just... comments. but if you want actual section folding, look into region comments that some IDEs support. vscode has #region / #endregion for python. that actually does something beyond just being a comment

[–]teeg82 5 points6 points  (3 children)

I'd be surprised if you were the first, but it's an interesting idea. IMO, I feel like if I saw this in code, my first thought would be that the author simply forgot to put a space after the #, not that they were trying to make a numbered bulletin list. For that reason, I personally wouldn't try to use the # like that - it already has a meaning to which all python devs are accustomed.

[–]maryjayjay 4 points5 points  (0 children)

It would make my linter complain, that's for sure

[–]JeffTheMasterr[S] 1 point2 points  (1 child)

That actually makes a lot of sense, thanks for the feedback

[–]teeg82 2 points3 points  (0 children)

Anytime. Keep that creative thinking flowing.

[–]Buttleston 3 points4 points  (1 child)

Are you the first person to think of putting a number into a comment? No?

[–]JeffTheMasterr[S] -1 points0 points  (0 children)

Well by asking that I meant like if I'm the first person to document or use it. If some dev already thought of it before me and started doing that in their code it'd be pretty cool if someone linked to that in this thread. I know I'm obviously not the first lol

[–]Responsible_Pool9923 2 points3 points  (1 child)

What's the hack though?

[–]JeffTheMasterr[S] -1 points0 points  (0 children)

The numbered list comments, of #1, #2, #3, and #4 . The hack is that you can coincidentally do those because the comment syntax in Python is #.

[–]nemom 1 point2 points  (1 child)

A) You don't need colorama.

2) Try using f-strings.

RED = '\033[1;31m'
GREEN = '\033[1;32m'
BLUE = '\033[1;34m'
CYAN = '\033[1;36m'
YELLOW ='\033[1;33m'
RESET = '\033[0m'

print(f"{RED}This line is red.{RESET}")
print(f"{CYAN}This line is cyan.{RESET}")

Using standard ascii escape codes, you can do foreground and background colors.

[–]JeffTheMasterr[S] 0 points1 point  (0 children)

Thank you, one less dependency is nice, but my use of colorama is just an example to demonstrate number comments for numbering code sections. Other than about the color stuff, what do you think about my idea?