Sorry, -1.
Is this really worth the hassle when you can write (more explicitly)
def my_fun():
raise NotImplementedError # todo
Python has grown steadily more complicated in its lifetime. Usually for
good reasons. But each additional feature adds to the learning curve
and the maintenance
Moreover, I have worked on a lot of code where ellipsis is used to mean
"this branch isn't implemented yet, but doing nothing isn't terrible."
I don't love that code. I'd rather it use `pass` and a clarifying comment.
But this change would make all that existing code much more broken.
On Sat,
I agree. Giving punctuation-based syntax like ... a meaning that isn't
obvious on reading the code makes for unreadable code. Whereas having
`raise Exception ('TODO')` accomplishes the same thing but also allows
English documentation. The ... here is open to interpretation, especially
as a new
Raising an exception in that case would be a breaking change only for an
aesthetic preference.
Some codes use ellipsis as this in functions body and don't want it to
raise an error.
Also it's going to be confusing to understand why an exception is raised in
that place.
Le jeu. 27 avr. 2023 à