[Python-Dev] the role of assert in the standard library ?

Terry Reedy tjreedy at udel.edu
Thu Apr 28 22:56:54 CEST 2011


On 4/28/2011 11:22 AM, skip at pobox.com wrote:
>
>      Barry>  I would agree.  Use asserts for "this can't possibly happen
>      Barry>  <wink>" conditions.
>
> Without looking, I suspect that's probably what the author thought he was
> doing.

You wish: to repeat the example from threading:

    def __init__(self, group=None, target=None, name=None,
                  args=(), kwargs=None, verbose=None):
         assert group is None, "group argument must be None for now"

is something that can easily happen.

-- 
Terry Jan Reedy



More information about the Python-Dev mailing list