Warning: Some posts on this platform may contain adult material intended for mature audiences only. Viewer discretion is advised. By clicking ‘Continue’, you confirm that you are 18 years or older and consent to viewing explicit content.
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.
that’s still a docstring, idk of linters that take docstrings into account at all. We need a semantic approach for this kind of annotation.
That’s way harder to ask for. A docstring solution is fine so long as the linters know to pick it up.
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.