How to disable assert statements inside a module?

Martin v. Loewis martin at v.loewis.de
Sun Mar 10 15:52:45 EST 2002


Pearu Peterson <pearu at cens.ioc.ee> writes:

> Is there a way to disable all assert statements inside a module,
> and without calling python with -O switch?

You can set __debug__ to 0 on the module level; this will disable
assert statements inside this module.

Regards,
Martin



More information about the Python-list mailing list