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 à 15:50, haael <[email protected]> a écrit :

>
> In examples in the web very often we see unfinished or partial code,
> where the ellipsis "..." is used in place of missing instructions.
>
> Idea: make ellipsis used in that context throw an exception, reminding
> the user that this code is work in progress.
>
> The exception could be called ToDoError, or WorkInProgressError, or
> simply EllipsisError, and could be derived from NotImplementedError.
>
>
> ```
>
> def my_fun():
>     ... # todo
>
> my_fun()
>
>  > WorkInProgressError: Implementation of `my_fun` is not finished.
>
> ```
>
> This change could break some code, as for now ellipsis in the middle of
> code is silently ignored, but I don't think anybody seriously relies on
> that behavior.
>
> haael
>
> _______________________________________________
> Python-ideas mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
> https://mail.python.org/mailman3/lists/python-ideas.python.org/
> Message archived at
> https://mail.python.org/archives/list/[email protected]/message/QAU7LB46VGVZYESJUI6RKM2UB3WQR5N4/
> Code of Conduct: http://python.org/psf/codeofconduct/
>


-- 
Antoine Rozo
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/6RX2H4WBASSUIBYB62GFPCTYZ6S3WBMW/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to