this post was submitted on 12 May 2024
512 points (97.2% liked)

Programmer Humor

31224 readers
50 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 4 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[โ€“] [email protected] 1 points 1 month ago (1 children)

That's way harder to ask for. A docstring solution is fine so long as the linters know to pick it up.

[โ€“] [email protected] 1 points 1 month ago* (last edited 1 month ago)

I don't think so. A half-measure using docstrings would likely take more processing power and require an ad-hoc implementation because comments are not broken down into ast components afaik. It would also be more costly in the long run if they decide to convert it into a proper syntax, as a result of docstrings not having a single standard way of being written.

Python has introduced several syntactic changes for type annotations, this is not unreasonable.