On Mon, May 18, 2020 at 8:04 AM Richard Damon <rich...@damon-family.org> wrote:
> If you really what what you describe, add the following to your code:
>
> if not __debug__:
>
>     raise AssertionError, "Please don't disable assertions"
>
> (This won't enable the assertions, but will let the user know that you
> need them enabled)
>

As a bonus that also asserts that you're running an ancient version of
Python.... probably not what you want :)

if not __debug__:
    raise AssertionError("Assertions are required for this module,
because it is broken.")

ChrisA
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/TF5LWWK7OGGRHQVSUQ5RQAEQZ2YWC7CL/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to